BlaziumBigNum
Inherits: RefCounted < Object
Number representation up to 1e(2^64), useful for incremental games.
Description
Number representation up to 1e(2^64), useful for incremental games.
Tutorials
Methods
Method Descriptions
BlaziumBigNum abs_num() const 🔗
Returns the absolute value.
BlaziumBigNum add(other: BlaziumBigNum) const 🔗
Adds other and returns the new value.
String as_string(precision: int = -1) const 🔗
Returns the value as a string with a specified precision.
Use to_pretty_string() if you need the scientific e notation.
int compare_to(other: BlaziumBigNum) const 🔗
Does a comparison with other.
Returns 1 if other is bigger, -1 if other is smaller and 0 if it is equal.
BlaziumBigNum div(other: BlaziumBigNum) const 🔗
Divides by other and returns the new value.
BlaziumBigNum exp(n: int) static 🔗
Returns e^n.
BlaziumBigNum from_bignum(value: BlaziumBigNum) static 🔗
Creates a BlaziumBigNum from value.
BlaziumBigNum from_float(value: float) static 🔗
Creates a BlaziumBigNum from value.
BlaziumBigNum from_mantissa_exponent(mantissa: float, exponent: int) static 🔗
Creates a BlaziumBigNum from a mantissa and a exponent.
BlaziumBigNum from_string(value: String) static 🔗
Creates a BlaziumBigNum from a string representing a number, supports scientific e notation.
var big_num = BlaziumBigNum.from_string("1.2e200")
int get_default_max_digits() static 🔗
Returns the default amount of "real" digits to display before using scientific notation.
int get_default_print_precision() static 🔗
Returns the default amount of fractional digits to display on scientific notation.
Returns the exponent.
BlaziumBigNum get_inf() static 🔗
Returns the infinite representation.
Returns the mantissa.
BlaziumBigNum get_max() static 🔗
Returns the maximum value.
BlaziumBigNum get_min() static 🔗
Returns the minimum value.
BlaziumBigNum get_nan() static 🔗
Returns the not-a-number representation.
bool is_approximately_equal(other: BlaziumBigNum, tolerance: float = 1e-09) const 🔗
Returns true if other is equal within a tolerance.
bool is_equal_to(other: BlaziumBigNum) const 🔗
Returns true if other is equal.
bool is_greater_than(other: BlaziumBigNum) const 🔗
Returns true if other is smaller.
bool is_greater_than_or_equal_to(other: BlaziumBigNum) const 🔗
Returns true if other is smaller or equal.
Returns true if is infinite.
bool is_less_than(other: BlaziumBigNum) const 🔗
Returns true if other is greater.
bool is_less_than_or_equal_to(other: BlaziumBigNum) const 🔗
Returns true if other is greater or equal.
Returns true if is not a number.
Returns true if is negative.
Returns true if is positive.
Returns log10(num), or NAN if the result would be too large.
BlaziumBigNum max_of(a: BlaziumBigNum, b: BlaziumBigNum) static 🔗
Returns the greater of a and b.
BlaziumBigNum min_of(a: BlaziumBigNum, b: BlaziumBigNum) static 🔗
Returns the smaller of a and b.
BlaziumBigNum mul(other: BlaziumBigNum) const 🔗
Multiplies by other and returns the new value.
BlaziumBigNum negate() const 🔗
Returns the negative.
void parse_float(value: float) 🔗
Sets the value using value.
void parse_mantissa_exponent(mantissa: float, exponent: int) 🔗
Sets the value using a mantissa and a exponent.
void parse_string(value: String) 🔗
Sets the value using a string representing a number, supports scientific e notation.
BlaziumBigNum pow_float(power: float) const 🔗
Returns num^power.
BlaziumBigNum pow_int(power: int) const 🔗
Returns num^power.
BlaziumBigNum root(n: int) const 🔗
Returns the nth root.
void set_default_max_digits(max_digits: int) static 🔗
Sets the default amount of "real" digits to display before using scientific notation.
void set_default_print_precision(precision: int) static 🔗
Sets the default amount of fractional digits to display on scientific notation.
BlaziumBigNum sqroot() const 🔗
Returns the square root.
BlaziumBigNum sub(other: BlaziumBigNum) const 🔗
Subtracts other and returns the new value.
Returns the value as a integer.
String to_pretty_string(precision: int = -1) const 🔗
Returns the value as a string using scientific e notation with a specified precision.