From: George H. <geo...@us...> - 2006-01-30 13:58:19
|
Update of /cvsroot/win32forth/win32forth/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4801/win32forth/doc Modified Files: p-float.htm Log Message: gah: More Dexing (still work in progress) Index: p-float.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/doc/p-float.htm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** p-float.htm 28 Jan 2006 10:28:30 -0000 1.3 --- p-float.htm 30 Jan 2006 13:58:10 -0000 1.4 *************** *** 61,67 **** POSTPONEd. </p><pre><b><a name="0">: FCONSTANT \ ANSI Floating ! </a></b></pre><p><b> Compiling: ( -<name>- ) ( F: r -- ) <br /> ! </b><b> Run-time: ( F: -- r ) </b> <br /> ! </p><p>Define an FP constant. </p><h3>Stack operations </h3><pre><b><a name="0">code FDROP ( fs: r -- ) \ ANSI Floating --- 61,77 ---- POSTPONEd. </p><pre><b><a name="0">: FCONSTANT \ ANSI Floating ! </a></b></pre><p> <b> Interpretation: ( -<name>- ) ( F: r -- ) </b> <br /> ! Define an FP constant. <br /> ! <b> Compilation: </b> <br /> ! Append the run-time semantics given below to the current definition. <br /> ! <b> Run-time: ( F: -- r ) </b> <br /> ! Place r on the floating-point stack. ! </p><pre><b><a name="0">: FLITERAL ( fs: r -- ) \ ANSI Floating ! </a></b></pre><p> <b> Interpretation: </b> <br /> ! Interpretation semantics for this word are undefined. <br /> ! <b> Compilation: ( F: r -- ) </b> <br /> ! Append the run-time semantics given below to the current definition. <br /> ! <b> Run-time: ( F: -- r ) </b> <br /> ! Place r on the floating-point stack. </p><h3>Stack operations </h3><pre><b><a name="0">code FDROP ( fs: r -- ) \ ANSI Floating *************** *** 71,75 **** </p><pre><b><a name="0">code FSWAP ( fs: r1 r2 -- r2 r1 ) \ ANSI Floating </a></b></pre><p>Exchange the top 2 FP numbers. ! </p><pre><b><a name="0">code FOVER ( fs: r1 r2 -- r1 r2 r3 ) \ ANSI Floating </a></b></pre><p>Copy the 2nd FP stack number to the top of the FP stack. </p><pre><b><a name="0">code FROT ( fs: r1 r2 r3 -- r2 r3 r1 ) \ ANSI Floating --- 81,85 ---- </p><pre><b><a name="0">code FSWAP ( fs: r1 r2 -- r2 r1 ) \ ANSI Floating </a></b></pre><p>Exchange the top 2 FP numbers. ! </p><pre><b><a name="0">code FOVER ( fs: r1 r2 -- r1 r2 r1 ) \ ANSI Floating </a></b></pre><p>Copy the 2nd FP stack number to the top of the FP stack. </p><pre><b><a name="0">code FROT ( fs: r1 r2 r3 -- r2 r3 r1 ) \ ANSI Floating *************** *** 84,88 **** </p><pre><b><a name="0">code F2DROP ( fs: r1 r2 -- ) \ W32F Floating extra </a></b></pre><p>Remove the top 2 FP stack entries. ! </p><pre><b><a name="0">: F2DUP ( fs: r1 r2 -- r1 r2 r3 r4 ) \ W32F Floating extra </a></b></pre><p>Duplicate the top 2 FP stack entries. </p><pre><b><a name="0">: F2SWAP ( fs: r1 r2 r3 r4 -- r3 r4 r2 r1 ) \ W32F Floating extra --- 94,98 ---- </p><pre><b><a name="0">code F2DROP ( fs: r1 r2 -- ) \ W32F Floating extra </a></b></pre><p>Remove the top 2 FP stack entries. ! </p><pre><b><a name="0">: F2DUP ( fs: r1 r2 -- r1 r2 r1 r2 ) \ W32F Floating extra </a></b></pre><p>Duplicate the top 2 FP stack entries. </p><pre><b><a name="0">: F2SWAP ( fs: r1 r2 r3 r4 -- r3 r4 r2 r1 ) \ W32F Floating extra *************** *** 102,106 **** </a></b></pre><p>Push the value of log base 10 of 2. </p><pre><b><a name="0">code fLn2 ( fs: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push the vlue of ln 2 (the natural logarithm). </p><pre><b><a name="0"> f1.0 fconstant f0.0 ( FS: -- r ) \ W32F Floating extra </a></b></pre><p>Push plus zero. --- 112,116 ---- </a></b></pre><p>Push the value of log base 10 of 2. </p><pre><b><a name="0">code fLn2 ( fs: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push the value of ln 2 (the natural logarithm). </p><pre><b><a name="0"> f1.0 fconstant f0.0 ( FS: -- r ) \ W32F Floating extra </a></b></pre><p>Push plus zero. *************** *** 108,112 **** </a></b></pre><p>Push plus infinity. </p><pre><b><a name="0"> f1.0 fconstant f2.0 ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push 2.0 </p><h3>Rounding Modes </h3><pre><b><a name="0">code FLOOR ( fs: f1 -- fs: f2 ) \ ANSI Floating --- 118,139 ---- </a></b></pre><p>Push plus infinity. </p><pre><b><a name="0"> f1.0 fconstant f2.0 ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push floating-point 2.0. ! </p><pre><b><a name="0"> f0.0 fconstant f10.0 ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push floating-point 10.0. ! </p><pre><b><a name="0"> f1.0 fconstant f0.5 ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push floating-point 0.5. ! </p><pre><b><a name="0"> f0.0 fconstant fbig ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push the largest non-infinite floating-point number. ! </p><pre><b><a name="0"> f0.0 fconstant feps ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push the smallest non-zero floating-point number. ! </p><pre><b><a name="0"> f1.0 fconstant fsmall ( FS: -- r ) \ W32F Floating extra ! </a></b></pre><p>Push the smallest non-denormalised floating-point number. ! </p><h3>Variables ! </h3><pre><b><a name="0"> fvariable a2**63 ( -- addr ) \ W32F Floating extra ! </a></b></pre><p>Return the address of a float containing 2**63. ! </p><pre><b><a name="0"> fvariable sq2m1 ( -- addr ) \ W32F Floating extra ! </a></b></pre><p>Return the address of a float containing sqrt(2) - 1. ! </p><pre><b><a name="0"> fvariable sq2/2m1 ( -- addr ) \ W32F Floating extra ! </a></b></pre><p>Return the address of a float containing sqrt(2)/2 - 1. </p><h3>Rounding Modes </h3><pre><b><a name="0">code FLOOR ( fs: f1 -- fs: f2 ) \ ANSI Floating *************** *** 119,123 **** </a></b></pre><p>Set rounding mode to round to nearest. </p><h3>Integer to float coversion ! </h3><h3>Comparison operators </h3><h3>Maths operators </h3><pre><b><a name="0">code F+ ( fs: r1 r2 -- r3 ) \ ANSI Floating --- 146,155 ---- </a></b></pre><p>Set rounding mode to round to nearest. </p><h3>Integer to float coversion ! </h3><pre><b><a name="0">code D>F ( d -- ) ( F: -- r ) \ ANSI Floating ! </a></b></pre><p>Convert double number to floating-point number. ! </p><pre><b><a name="0">code F>D ( -- d ) ( fs: r -- ) \ ANSI Floating ! </a></b></pre><p>Convert floating-point number to double number. If the result would be too large ! to fit in a double number then <br /> -9223372036854775808 is returned. ! </p><h3>Comparison operators </h3><h3>Maths operators </h3><pre><b><a name="0">code F+ ( fs: r1 r2 -- r3 ) \ ANSI Floating *************** *** 132,139 **** </a></b></pre><p>Reverse the sign of r1. </p><h3>Trigonometric functions ! </h3><h3>Inverse Trigonometric functions ! </h3><pre><b><a name="0">code FATAN2 ( fs: r1 r2 -- r3 ) \ ANSI Floating ext ! </a></b></pre><p>r3 is the radian angle whose tangent is r1/r2. If r1 and r2 are both zero then r3 ! is zero. </p><h3>Output conversion. </h3><pre><b><a name="0">: PRECISION ( -- u ) \ ANSI Floating ext --- 164,193 ---- </a></b></pre><p>Reverse the sign of r1. </p><h3>Trigonometric functions ! </h3><pre><b><a name="0">: FSIN ( f: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the sine of r1 in radians. ! </p><pre><b><a name="0">: FCOS ( f: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the cosine of r1 in radians. ! </p><pre><b><a name="0">: FSINCOS ( f: r1 -- r2 r3 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the sine and r3 the cosine of r1 in radians. This function is more efficient ! than calling FSIN and FCOS separately. ! </p><pre><b><a name="0">: FTAN ( f: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the tangent of r1 in radians. ! </p><h3>Inverse Trigonometric functions ! </h3><pre><b><a name="0">code FASIN ( fs: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the radian angle whose sine is r1. The result for |x| =< 1 is between ±pi/2. ! The result for |x| > 1 is NAN. ! </p><pre><b><a name="0">code FACOS ( fs: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the radian angle whose cosine is r1. The result for |x| =< 1 is between 0 and pi. ! The result for |x| > 1 is NAN ! </p><pre><b><a name="0">code FATAN ( fs: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>r2 is the radian angle whose tangent is r1. The result is between ±pi/2. ! </p><pre><b><a name="0">code FATAN2 ( fs: r1 r2 -- r3 ) \ ANSI Floating ext ! </a></b></pre><p>r3 is the radian angle whose tangent is r1/r2. The result is between ±pi ! with the same sign as r2. If r1 and r2 are both zero then r3 is ±zero. ! This function can be used to convert cartesian coordinates into the angle of the ! polar coordinates. ! </p><h3>Logarithmic functions ! </h3><pre><b><a name="0">code FLNP1 ( fs: r1 -- r2 ) \ ANSI Floating ext ! </a></b></pre><p>? error for x <= -1 </p><h3>Output conversion. </h3><pre><b><a name="0">: PRECISION ( -- u ) \ ANSI Floating ext |