Bignum Type

Bignums are “arbitrary” precision integers or floating point numbers with a concept of exactness.

In principle, bignums allow arbitrary precision but most operations involving bignums (including reading them in!) will “normalize” the result to a value with up to 18 significant digits.

A bignum exponent is a signed 32-bit entity.

There is no support for special values such as “not a number” and infinities.

Bignum Predicates

function bignum? o

test if o is a bignum

Param o:

object to test

Return:

#t if o is a bignum, #f otherwise

function real? n

test if n is a real

Param n:

number to test

Type n:

bignum

Return:

#t if n is a real, #f otherwise

function exact? n

test if n is exact

Param n:

number to test

Type n:

bignum or fixnum

Return:

#t if n is exact, #f otherwise

function inexact? n

test if n is inexact

Param n:

number to test

Type n:

bignum or fixnum

Return:

#t if n is inexact, #f otherwise

Bignum Attributes

function mantissa n

return the mantissa of n

Param n:

number to find mantissa of

Type n:

bignum or fixnum

Return:

mantissa of n

function exponent n

return the exponent of n

Param n:

number to find exponent of

Type n:

bignum

Return:

exponent of n

Bignum Converters

function exact->inexact n

return an inexact version of n

Param n:

number to convert

Type n:

bignum or fixnum

Return:

inexact value of n

function inexact->exact n

return an exact version of n

Param n:

number to convert

Type n:

bignum or fixnum

Return:

exact value of n

Bignum Utilities

function bignum-dump n

dump the bignum structure of n to stderr

Param n:

number to dump

Type n:

bignum

Return:

#<unspec>

Last built at 2024-12-21T07:10:44Z+0000 from 62cca4c (dev) for Idio 0.3.b.6