Crate break_infinity[][src]

Structs

Decimal

Constants

EXP_LIMIT
MAX_SAFE_INTEGER
MAX_SIGNIFICANT_DIGITS

Highest value you can safely put here is MAX_SAFE_INTEGER

NUMBER_EXP_MAX

The smallest exponent that can appear in a Number, though not all mantissas are valid here.

NUMBER_EXP_MIN

The largest exponent that can appear in a Number, though not all mantissas are valid here.

ROUND_TOLERANCE

Tolerance which is used for Number conversion to compensate floating-point error.

Functions

afford_arithmetic_series

If you’re willing to spend ‘resourcesAvailable’ and want to buy something with additively increasing cost each purchase (start at priceStart, add by priceAdd, already own currentOwned), how much of it can you buy?

afford_geometric_series

If you’re willing to spend ‘resourcesAvailable’ and want to buy something with exponentially increasing cost each purchase (start at priceStart, multiply by priceRatio, already own currentOwned), how much of it can you buy? Adapted from Trimps source code.

efficiency_of_purchase

When comparing two purchases that cost (resource) and increase your resource/sec by (deltaRpS), the lowest efficiency score is the better one to purchase. From Frozen Cookies: http://cookieclicker.wikia.com/wiki/Frozen_Cookies_(JavaScript_Add-on)#Efficiency.3F_What.27s_that.3F

from_decimal
from_mantissa_exponent
from_mantissa_exponent_no_normalize
from_string
new
pad_end
random_decimal_for_testing
sum_arithmetic_series

How much resource would it cost to buy (numItems) items if you already have currentOwned, the initial price is priceStart and it adds priceAdd each purchase? Adapted from http://www.mathwords.com/a/arithmetic_series.htm

sum_geometric_series

How much resource would it cost to buy (numItems) items if you already have currentOwned, the initial price is priceStart and it multiplies by priceRatio each purchase?

to_fixed
to_fixed_num