System Variable FPC: Difference between revisions

From NARS2000
Jump to navigationJump to search
(Created page with "=Floating Point Control= <table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary="">...")
 
Line 34: Line 34:
       <td></td>
       <td></td>
       <td></td>
       <td></td>
       <td>sets the value of the Floating Point Control precision its system default state.</td>
       <td>sets the value of the Floating Point Control precision to its system default state.</td>
     </tr>
     </tr>
     </table>
     </table>
Line 45: Line 45:


<p>The system default value is <apll>53</apll>.</p>
<p>The system default value is <apll>53</apll>.</p>
<p>For example,</p>
<apll>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕PP←200<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕FPC←53 ⋄ *1x<br />
2.7182818284590450908<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕FPC←64 ⋄ *1x<br />
2.71828182845904523543<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕FPC←128 ⋄ *1x<br />
2.718281828459045235360287471352662497759<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕FPC←256 ⋄ *1x<br />
2.718281828459045235360287471352662497757247093699959574966967627724076630353555<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕FPC←512 ⋄ *1x<br />
2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059559</apll>
<p>Whereas, according to Wolfram Alpha, the exact value to 230 digits is</p>
<apll>2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488...</apll><br />

Revision as of 17:47, 18 August 2011

Floating Point Control

Z←⎕FPC returns the current value of the Floating Point Control precision.
Z is an integer scalar that represents the current value of the number of bits of precision used for VFP numbers.


⎕FPC←R sets the value of the Floating Point Control precision to R.
⎕FPC←⍬ sets the value of the Floating Point Control precision to its system default state.


The minimum value for ⎕FPC is 53; the maximum value is the largest positive integer 9223372036854775807.

The system default value is 53.

For example,

      ⎕PP←200
      ⎕FPC←53 ⋄ *1x
2.7182818284590450908
      ⎕FPC←64 ⋄ *1x
2.71828182845904523543
      ⎕FPC←128 ⋄ *1x
2.718281828459045235360287471352662497759
      ⎕FPC←256 ⋄ *1x
2.718281828459045235360287471352662497757247093699959574966967627724076630353555
      ⎕FPC←512 ⋄ *1x
2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059559

Whereas, according to Wolfram Alpha, the exact value to 230 digits is

2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488...