Next: , Previous: , Up: Types of Numbers   [Contents][Index]


63.2.4 The Type ‘bigfr

The type ‘bigfr’ is an abstract C type for arbitrary-precision real number approximations with correct rounding facilities (so called floats). The actual C type is provided by the MPFR library and is called ‘mpfr_t’.

Any other library which implements something similar to MPFR, should be accessed via the abstract type ‘bigfr’, too.

We have chosen to not regard MPFR and GMP-MPF as equivalent. MPFR provides a lot more behind the scenes.

Lisp objects can be tested for the type ‘bigfr’ by the following predicate.

Function: bigfrp object

This predicate tests whether its argument is a MP-float (as provided by MPFR), and returns t if so, nil otherwise.

The read syntax (and print syntax) of ‘bigfr’s is the same as for emacs floats. The interpretation in the lisp reader depends on the variable read-real-as (see Category real).

There are no other forms of creation, especially there are no constructors for ‘bigfr’ objects.

As required by MPFR, SXEmacs supports indefinite number values which can occur as return values of some MPFR functions. Such number objects, however, are not of type ‘bigfr’ anymore. We provide a more general handling for these, see Type indefinite for more information.

Again, numbers of type ‘bigfr’ can be assigned a precision. This precision can be queried and even may be changed at any time.

Function: bigfr-get-precision number

Return the precision of number as an integer.

Function: bigfr-set-precision number precision

Set the precision of number to precision, a nonnegative integer. The new precision of number is returned.

Note that the return value may differ from precision if the underlying library is unable to support exactly precision bits of precision. Note also, that setting the precision is lossy, that means number after setting the precision is not necessarily the same as the original number.


Next: , Previous: , Up: Types of Numbers   [Contents][Index]