<HTML> <HEAD> <!-- This HTML file has been created by texi2html 1.52 from maxima.texi on 25 April 2001 --> <TITLE>Maxima Manual - Floating Point</TITLE> <link href="maxima_10.html" rel=Next> <link href="maxima_8.html" rel=Previous> <link href="maxima_toc.html" rel=ToC> </HEAD> <BODY> <p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_8.html">previous</A>, <A HREF="maxima_10.html">next</A>, <A HREF="maxima_41.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>. <P><HR><P> <H1><A NAME="SEC34" HREF="maxima_toc.html#TOC34">Floating Point</A></H1> <H2><A NAME="SEC35" HREF="maxima_toc.html#TOC35">Definitions for Floating Point</A></H2> <P> <DL> <DT><U>Function:</U> <B>BFFAC</B> <I>(exp,n)</I> <DD><A NAME="IDX275"></A> BFLOAT version of the Factorial (shifted Gamma) function. The 2nd argument is how many digits to retain and return, it's a good idea to request a couple of extra. This function is available by doing LOAD(BFFAC); . </DL> </P> <P> <DL> <DT><U>Variable:</U> <B>ALGEPSILON</B> <DD><A NAME="IDX276"></A> The default value is 10^-8. The value of ALGEPSILON is used by ALGSYS. </DL> </P> <P> <DL> <DT><U>Function:</U> <B>BFLOAT</B> <I>(X)</I> <DD><A NAME="IDX277"></A> converts all numbers and functions of numbers to bigfloat numbers. Setting FPPREC[16] to N, sets the bigfloat precision to N digits. If FLOAT2BF[FALSE] 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). </P> </DL> <P> <DL> <DT><U>Function:</U> <B>BFLOATP</B> <I>(exp)</I> <DD><A NAME="IDX278"></A> is TRUE if exp is a bigfloat number else FALSE. </P> </DL> <P> <DL> <DT><U>Function:</U> <B>BFPSI</B> <I>(n,z,fpprec)</I> <DD><A NAME="IDX279"></A> gives polygammas of real arg and integer order. For digamma, BFPSI0(z,fpprec) is more direct. Note -BFPSI0(1,fpprec) provides BFLOATed %GAMMA. To use this do LOAD(BFFAC); </P> </DL> <P> <DL> <DT><U>Variable:</U> <B>BFTORAT</B> <DD><A NAME="IDX280"></A> default: [FALSE] controls the conversion of bfloats to rational numbers. If <PRE> BFTORAT:FALSE </PRE> <P> RATEPSILON will be used to control the conversion (this results in relatively small rational numbers). If <PRE> BFTORAT:TRUE </PRE> <P> , the rational number generated will accurately represent the bfloat. </P> </DL> <P> <DL> <DT><U>Variable:</U> <B>BFTRUNC</B> <DD><A NAME="IDX281"></A> default: [TRUE] causes trailing zeroes in non-zero bigfloat numbers not to be displayed. Thus, if BFTRUNC:FALSE, BFLOAT(1); displays as 1.000000000000000B0. Otherwise, this is displayed as 1.0B0. </P> </DL> <P> <DL> <DT><U>Function:</U> <B>CBFAC</B> <I>(z,fpprec)</I> <DD><A NAME="IDX282"></A> a factorial for complex bfloats. It may be used by doing LOAD(BFAC); For more details see share2/bfac.usg. </P> </DL> <P> <DL> <DT><U>Function:</U> <B>FLOAT</B> <I>(exp)</I> <DD><A NAME="IDX283"></A> converts integers, rational numbers and bigfloats in exp to floating point numbers. It is also an EVFLAG, FLOAT causes non-integral rational numbers and bigfloat numbers to be converted to floating point. </P> </DL> <P> <DL> <DT><U>Variable:</U> <B>FLOAT2BF</B> <DD><A NAME="IDX284"></A> default: [FALSE] if 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). </P> </DL> <P> <DL> <DT><U>Function:</U> <B>FLOATDEFUNK</B> <DD><A NAME="IDX285"></A> - is a utility for making floating point functions from mathematical expression. It will take the input expression and FLOAT it, then OPTIMIZE it, and then insert MODE_DECLAREations for all the variables. This is THE way to use ROMBERG, PLOT2, INTERPOLATE, etc. e.g. EXP:some-hairy-macsyma-expression; </P> <PRE> FLOATDEFUNK('F,['X],EXP); </PRE> <P> will define the function F(X) for you. (Do PRINTFILE(MCOMPI,DOC,MAXDOC); for more details.) </P> </DL> <P> <DL> <DT><U>Function:</U> <B>FLOATNUMP</B> <I>(exp)</I> <DD><A NAME="IDX286"></A> is TRUE if exp is a floating point number else FALSE. </P> </DL> <P> <DL> <DT><U>Variable:</U> <B>FPPREC</B> <DD><A NAME="IDX287"></A> default: [16] - Floating Point PRECision. Can be set to an integer representing the desired precision. </P> </DL> <P> <DL> <DT><U>Variable:</U> <B>FPPRINTPREC</B> <DD><A NAME="IDX288"></A> default: [0] - 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. If FPPRINTPREC is 0 (the default), or >= FPPREC, then the value of FPPREC controls the number of digits used for printing. However, if 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.) </DL> </P> <P> <DL> <DT><U>Function:</U> <B>?ROUND</B> <I>(x,&optional-divisor)</I> <DD><A NAME="IDX289"></A> round the floating point X to the nearest integer. The argument must be a regular system float, not a bigfloat. The ? beginning the name indicates this is normal common lisp function. </P> <PRE> (C3) ?round(-2.8); (D3) - 3 </PRE> </DL> <P> <DL> <DT><U>Function:</U> <B>?TRUNCATE</B> <I>(x,&optional-divisor)</I> <DD><A NAME="IDX290"></A> truncate the floating point X towards 0, to become an integer. The argument must be a regular system float, not a bigfloat. The ? beginning the name indicates this is normal common lisp function. </DL> <PRE> (C4) ?truncate(-2.8); (D4) - 2 (C5) ?truncate(2.4); (D5) 2 (C6) ?truncate(2.8); (D6) 2 </PRE> <P> <DL> <DT><U>Variable:</U> <B>ZUNDERFLOW</B> <DD><A NAME="IDX291"></A> default: [TRUE] - if FALSE, an error will be signaled if floating point underflow occurs. Currently in NIL Macsyma, all floating-point underflow, floating-point overflow, and division-by-zero errors signal errors, and this switch is ignored. </P> </DL> <P><HR><P> <p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_8.html">previous</A>, <A HREF="maxima_10.html">next</A>, <A HREF="maxima_41.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>. </BODY> </HTML>