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

10. Floating Point


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

10.1 Functions and Variables for Floating Point

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.

Option variable: algepsilon

Default value: 10^8

algepsilon is used by algsys.

Categories:  Algebraic equations

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).

Categories:  Numerical evaluation

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 (z, fpprec) is equivalent to bfpsi (0, z, fpprec).

These functions return bigfloat values. fpprec is the bigfloat precision of the return value.

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.

Categories:  Numerical evaluation

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.

Categories:  Numerical evaluation

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).

Categories:  Numerical evaluation

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.

Categories:  Numerical evaluation

Option variable: fpprintprec

Default value: 0

fpprintprec is the number of digits to print when printing an ordinary float or bigfloat number.

For ordinary floating point numbers, when fpprintprec has a value between 2 and 16 (inclusive), the number of digits printed is equal to fpprintprec. Otherwise, fpprintprec is 0, or greater than 16, and the number of digits printed is 16.

For bigfloat numbers, when fpprintprec has a value between 2 and fpprec (inclusive), the number of digits printed is equal to fpprintprec. Otherwise, fpprintprec is 0, or greater than fpprec, and the number of digits printed is equal to fpprec.

fpprintprec cannot be 1.

Option variable: numer_pbranch

Default value: false

The option variable numer_pbranch controls the numerical evaluation of the power of a negative integer, rational, or floating point number. When numer_pbranch is true and the exponent is a floating point number or the option variable numer is true too, Maxima evaluates the numerical result using the principal branch. Otherwise a simplified, but not an evaluated result is returned.

Examples:

(%i1) (-2)^0.75;
(%o1) (-2)^0.75

(%i2) (-2)^0.75,numer_pbranch:true;
(%o2) 1.189207115002721*%i-1.189207115002721

(%i3) (-2)^(3/4);
(%o3) (-1)^(3/4)*2^(3/4)

(%i4) (-2)^(3/4),numer;
(%o4) 1.681792830507429*(-1)^0.75

(%i5) (-2)^(3/4),numer,numer_pbranch:true;
(%o5) 1.189207115002721*%i-1.189207115002721

Categories:  Numerical evaluation


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

This document was generated by root on June, 23 2010 using texi2html 1.76.