mixin gmp.Base
Description
Common behaviour shared between all GMP classes.
All the methods on this mixin that return gmp.Base infact return instances of the same type as the invocant – i.e. if gmp.Base#abs is called on a gmp.Integer it will return an Integer.
Instance methods
-
abs #
gmp.Base#abs() ⇒ gmp.BaseReturn the absolute value of
this. -
add #
gmp.Base#add(rhs) ⇒ gmp.Base-
rhs(Number|gmp.Base) – operand
Returns
this + rhsas the same concrete type asthis. -
-
cmp #
gmp.Base#cmp(rhs) ⇒ Number-
rhs(Number|gmp.Base) – value to compare with
Returns a positive value if
this > rhs, zero ifthis == rhs, and a negative value ifthis < rhs. -
-
div #
gmp.Base#div(rhs) ⇒ gmp.Base-
rhs(Number|gmp.Base) – operand
Returns
this / rhsas the same concrete type asthis. -
-
getDouble #
gmp.Base#getDouble() ⇒ NumberReturns the value as a floating point number
-
mul #
gmp.Base#mul(rhs) ⇒ gmp.Base-
rhs(Number|gmp.Base) – operand
Returns
this * rhsas the same concrete type asthis. -
-
sgn #
gmp.Base#sgn() ⇒ NumberReturn an integer indication the sign of the value: 1 if > 0, 0 if == 0, and -1 if < 0.
-
sub #
gmp.Base#sub(rhs) ⇒ gmp.Base-
rhs(Number|gmp.Base) – operand
Returns
this - rhsas the same concrete type asthis. -
-
toString #
gmp.Base#toString([base = 10]) ⇒ String-
base(Number) – base to represent value in.
Returns the value as a string
-