big_double library

Root exporter

Classes

BigDouble
The big_double implementation in Dart. This is capable of exceeding 1e308 and is based on Patashu's big_double.js implementation. https://patashu.github.io/big_double.js/index.html As compared to Dart's own BigInt which sacrifices speed and performance over time for accuracy, BigDouble focuses on sacrificing accuracy over time for far better performance (10-1000x) with a "good enough estimation". For this reason, it is very useful for creating incremental games or other quantities that do not need high accuracies at large magnitudes.
BigIntrospect
For altering the mantissa and exponent values within BigDouble. BigDouble by itself allows for introspection (viewing the values), but does not allow for modification in order to keep BigDouble instance normalized.

Extensions

DoubleBigDoublify on double
A simplified version of using BigDouble by just calling a simple getter methods DoubleBigDoublify.big
IntBigDoublify on int
A simplified version of using BigDouble by just calling a simple getter methods IntBigDoublify.big
NumBigDoublify on num
A simplified version of using BigDouble by just calling a simple getter methods NumBigDoublify.big
StringBigDoublify on String
A simplified version of using BigDouble on Strings
Tuple1BigDoublify on (double, int)
Converts a tuple in the form of (double,int) where the first element of double is the mantissa and the second element of int is the exponent into a BigDouble instance. Note: that this does not return any of the BigDouble.one or BigDouble.zero instances as covering these cases is futile.
Tuple2BigDoublify on (int, int)
Same as Tuple1BigDoublify but the first element is of type int.

Functions

absLog10(BigDouble value) double
Log base 10 magnitude. Utilizes a very rough calculation from CasualNumerics
acosh(BigDouble value) double
The hyperbolic "inverse" cosine function
affordArithmeticSeries({required BigDouble resourcesAvailable, required BigDouble priceStart, required BigDouble priceAdd, required BigDouble currentOwned}) BigDouble
asinh(BigDouble value) double
The hyperbolic "inverse" sine function
atanh(BigDouble value) double
The hyperbolic "inverse" tangent function
cbrt(BigDouble value) BigDouble
Performs a cube root on value.
cosh(BigDouble angle) BigDouble
The hyperbolic cosine function using angle
efficiencyOfPurchase({required BigDouble cost, required BigDouble currentResPerSec, required BigDouble deltaResPerSec}) BigDouble
exp(BigDouble value) BigDouble
Euler's number e raised to the power of value
ln(BigDouble value) double
Natural Logarithm
log(BigDouble value, [double? base]) double
Returns the log of value with an optional base
log10(BigDouble value) double
Log base 10. Utilizes a very rough calculation from CasualNumerics
log2(BigDouble value) double
Log base 2
max(BigDouble a, BigDouble b) BigDouble
Returns the max of two BigDouble instances.
min(BigDouble a, BigDouble b) BigDouble
Returns the min of two BigDouble instances.
pLog10(BigDouble value) double
Log base 10 clamped to 0.
pow(BigDouble value, dynamic t, [double? tolerance]) BigDouble
Raises a BigDouble value to power (ie value ^ t). Exponentiation
pow10(double power, [double? tolerance]) BigDouble
Computes 10^power with tolerance
sinh(BigDouble angle) BigDouble
The hyperbolic sine function using angle
sqrt(BigDouble value) BigDouble
Performs a square root on the BigDouble instance. If the argument is NaN or less than zero, this function will return BigDouble.nan.
sumArithmeticSeries({required BigDouble numItems, required BigDouble priceStart, required BigDouble priceAdd, required BigDouble currentOwned}) BigDouble
sumGeometricSeries({required BigDouble numItems, required BigDouble priceStart, required BigDouble priceRatio, required BigDouble currentOwned}) BigDouble
tanh(BigDouble angle) BigDouble
The hyperbolic tangent function using angle