parrotcode: big number library | |
Contents | Language Implementations | Lua |
lib/bc.pir - big number library
See original on http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lbc/
This implementation is based on the PMC BigInt, a wrapper over gmp (GNU multiple precision arithmetic library), see src/pmc/bigint.pmc.
Use PMC BigFloat when available.
bc.digits ([n])
bc.tostring (x)
bc.iszero (x)
bc.isneg (x)
bc.number (x)
bc.compare (x, y)
bc.__eq (x, y)
bc.__lt (x, y)
bc.add (x, y)
bc.sub (x, y)
bc.mul (x, y)
bc.pow (x, y)
bc.div (x, y)
bc.mod (x, y)
bc.sqrt (x)
bc.__unm (x)
Francois Perrad
|