Big class

Inheritance

Constructors

Big(dynamic n)
Big.zero({bool isNegative = false})

Properties

c List<int>
Returns an array of single digits
getter/setter pair
e int
Returns the exponent, Integer, -1e+6 to 1e+6 inclusive
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
maxDp double
The maximum value of dp and Big.dp.
final
maxPower double
The maximum magnitude of the exponent argument to the pow method.
final
RM RoundingMode
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
s int
Returns the sign, -1 or 1
getter/setter pair

Methods

abs() Big
Return a new Big whose value is the absolute value of this Big.
add(dynamic y) Big
Return a new Big whose value is the value of this Big plus the value of Big y.
cmp(dynamic y) int
Compare two Big
compareTo(Big other) int
Compares this object to another object.
override
div(dynamic y) Big
Return a new Big whose value is the value of this Big divided by the value of Big y, rounded, if necessary, to a maximum of Big.dp decimal places using rounding mode Big.rm.
eq(dynamic y) bool
Return true if the value of this Big is equal to the value of Big y, otherwise return false.
gt(dynamic y) bool
Return true if the value of this Big is greater than the value of Big y, otherwise return false.
gte(dynamic y) bool
Return true if the value of this Big is greater than or equal to the value of Big y, otherwise return false.
lt(dynamic y) bool
Return true if the value of this Big is less than the value of Big y, otherwise return false.
lte(dynamic y) bool
Return true if the value of this Big is less than or equal to the value of Big y, otherwise return false.
mod(dynamic y) Big
Return a new Big whose value is the value of this Big modulo the value of Big y.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Big x, String n) Big
Parse the number or string value passed to a Big constructor.
pow(int n) Big
Return a Big whose value is the value of this Big raised to the power n. If n is negative, round to a maximum of Big.dp decimal places using rounding mode Big.rm.
prec(int sd, [RoundingMode? _rm]) Big
Return a new Big whose value is the value of this Big rounded to a maximum precision of sd significant digits using rounding mode rm, or Big.rm if rm is not specified.
selfRound([int? dp, RoundingMode? roundingMode]) Big
sqrt() Big
Return a new Big whose value is the square root of the value of this Big, rounded, if necessary, to a maximum of Big.dp decimal places using rounding mode Big.rm.
sub(dynamic y) Big
Return a new Big whose value is the value of this Big minus the value of Big y.
times(dynamic y) Big
Return a new Big whose value is the value of this Big times the value of Big y.
toNumber() double
Return the value of this Big as a primitive number.
toString() String
Return a string representing the value of this Big. Return exponential notation if this Big has a positive exponent equal to or greater than Big.pe, or a negative exponent equal to or less than Big.ne. Omit the sign for negative zero.
override
toStringAsExponential({int? dp, RoundingMode? rm}) String
Return a string representing the value of this Big in exponential notation rounded to dp fixed decimal places using rounding mode rm, or Big.rm if rm is not specified.
toStringAsFixed({int? dp, RoundingMode? rm}) String
Return a string representing the value of this Big in normal notation rounded to dp fixed decimal places using rounding mode rm, or Big.rm if rm is not specified.
toStringAsPrecision([int? sd, RoundingMode? rm]) String
Return a string representing the value of this Big rounded to sd significant digits using rounding mode rm, or Big.rm if rm is not specified. Use exponential notation if sd is less than the number of digits necessary to represent the integer part of the value in normal notation.
valueOf() String
Return a string representing the value of this Big. Return exponential notation if this Big has a positive exponent equal to or greater than Big.pe, or a negative exponent equal to or less than Big.ne. Include the sign for negative zero.

Operators

operator %(dynamic other) Big
See Big.mod
operator *(dynamic other) Big
See Big.times
operator +(dynamic other) Big
See Big.add
operator -(dynamic other) Big
See Big.sub
operator /(dynamic other) Big
See Big.div
operator <(dynamic other) bool
See Big.lt
operator <=(dynamic other) bool
See Big.lte
operator ==(dynamic other) bool
The equality operator.
override
operator >(dynamic other) bool
See Big.gt
operator >=(dynamic other) bool
See Big.gte
operator unary-() Big

Static Properties

dp int
The maximum number of decimal places (dp) of the results of operations involving division: div and sqrt, and pow with negative exponents.
getter/setter pair
ne int
The negative exponent (ne) at and beneath which toString returns exponential notation. (Dart numbers: -7) -1000000 is the minimum recommended exponent value of a Big.
getter/setter pair
pe int
The positive exponent (pe) at and above which toString returns exponential notation. (Dart numbers: 21) 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.
getter/setter pair
rm RoundingMode
The rounding mode (rm) used when rounding to the above decimal places.
getter/setter pair
strict bool
When true, an error will be thrown if a primitive number is passed to the Big constructor, or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a primitive number without a loss of precision.
getter/setter pair