[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

10.1 Definitions for Floating Point |

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

__Function:__**bffac***(*`expr`,`n`)Bigfloat version of the factorial (shifted gamma) function. The second argument is how many digits to retain and return, it's a good idea to request a couple of extra.

`load ("bffac")`

loads this function.

__Option variable:__**algepsilon**Default value: 10^8

`algepsilon`

is used by`algsys`

.

__Function:__**bfloat***(*`expr`)Converts all numbers and functions of numbers in

`expr`to bigfloat numbers. The number of significant digits in the resulting bigfloats is specified by the global variable`fpprec`

.When

`float2bf`

is`false`

a warning message is printed when a floating point number is converted into a bigfloat number (since this may lead to loss of precision).

__Function:__**bfloatp***(*`expr`)Returns

`true`

if`expr`is a bigfloat number, otherwise`false`

.

__Function:__**bfpsi***(*`n`,`z`,`fpprec`)__Function:__**bfpsi0***(*`z`,`fpprec`)`bfpsi`

is the polygamma function of real argument`z`and integer order`n`.`bfpsi0`

is the digamma function.`bfpsi0 (`

is equivalent to`z`,`fpprec`)`bfpsi (0,`

.`z`,`fpprec`)These functions return bigfloat values.

`fpprec`is the bigfloat precision of the return value.`load ("bffac")`

loads these functions.

__Option variable:__**bftorat**Default value:

`false`

`bftorat`

controls the conversion of bfloats to rational numbers. When`bftorat`

is`false`

,`ratepsilon`

will be used to control the conversion (this results in relatively small rational numbers). When`bftorat`

is`true`

, the rational number generated will accurately represent the bfloat.

__Option variable:__**bftrunc**Default value:

`true`

`bftrunc`

causes trailing zeroes in non-zero bigfloat numbers not to be displayed. Thus, if`bftrunc`

is`false`

,`bfloat (1)`

displays as`1.000000000000000B0`

. Otherwise, this is displayed as`1.0B0`

.

__Function:__**cbffac***(*`z`,`fpprec`)Complex bigfloat factorial.

`load ("bffac")`

loads this function.

__Function:__**float***(*`expr`)Converts integers, rational numbers and bigfloats in

`expr`to floating point numbers. It is also an`evflag`

,`float`

causes non-integral rational numbers and bigfloat numbers to be converted to floating point.

__Option variable:__**float2bf**Default value:

`false`

When

`float2bf`

is`false`

, a warning message is printed when a floating point number is converted into a bigfloat number (since this may lead to loss of precision).

__Function:__**floatnump***(*`expr`)Returns

`true`

if`expr`is a floating point number, otherwise`false`

.

__Option variable:__**fpprec**Default value: 16

`fpprec`

is the number of significant digits for arithmetic on bigfloat numbers.`fpprec`

does not affect computations on ordinary floating point numbers.See also

`bfloat`

and`fpprintprec`

.

__Option variable:__**fpprintprec**Default value: 0

`fpprintprec`

is the number of digits to print when printing a bigfloat number, making it possible to compute with a large number of digits of precision, but have the answer printed out with a smaller number of digits.When

`fpprintprec`

is 0, or greater than or equal to`fpprec`

, then the value of`fpprec`

controls the number of digits used for printing.When

`fpprintprec`

has a value between 2 and`fpprec - 1`

, then it controls the number of digits used. (The minimal number of digits used is 2, one to the left of the point and one to the right.The value 1 for

`fpprintprec`

is illegal.

__Lisp function:__**?round***(*`x`)__Lisp function:__**?round***(*`x`,`divisor`)Round the floating point

`x`to the nearest integer. The argument must be an ordinary float, not a bigfloat. The`?`

beginning the name indicates this is a Lisp function.(%i1) ?round (-2.8); (%o1) - 3

__Lisp function:__**?truncate***(*`x`)__Lisp function:__**?truncate***(*`x`,`divisor`)Truncate the floating point

`x`towards 0, to become an integer. The argument must be an ordinary float, not a bigfloat. The`?`

beginning the name indicates this is a Lisp function.(%i1) ?truncate (-2.8); (%o1) - 2 (%i2) ?truncate (2.4); (%o2) 2 (%i3) ?truncate (2.8); (%o3) 2

[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

This document was generated on *March, 19 2006* using *texi2html 1.76*.