Crate break_infinity

Crate break_infinity 

Source

Macros§

impl_from

Structs§

CACHED_POWERS
Decimal
A struct representing a decimal number, which can reach a maximum of 1e1.79e308 instead of f64’s maximum of 1.79e308.

Constants§

EXP_LIMIT
LENGTH
The length of the cache used for powers of 10.
MAX_SAFE_INTEGER
MAX_SIGNIFICANT_DIGITS
NUMBER_EXP_MAX
The largest exponent that can appear in an f64, though not all mantissas are valid here.
NUMBER_EXP_MIN
The smallest exponent that can appear in an f64, though not all mantissas are valid here.
ROUND_TOLERANCE
Tolerance which is used for f64 conversion to compensate for 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?
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_mantissa_exponent
Creates a new instance of Decimal with the given mantissa and exponent with normalizing them.
from_mantissa_exponent_no_normalize
Creates a new instance of Decimal with the given mantissa and exponent without normalizing them.
pad_end
Pads the given string with the fill string to the given max length.
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
Formats the given number to the given number of significant digits.
to_fixed_num
Formats the given number to the given number of significant digits and parses it back to a number.