DPANS12.HTM (40307B)
1 <HTML><HEAD> 2 <TITLE>DPANS94</TITLE> 3 <link disabled rel="stylesheet" href="mpexc6.css"> 4 <style>@import url(mpexc6.css);</style> 5 </head> 6 7 <BODY> 8 <table width=100%> 9 <tr> 10 <td align=left> 11 <a href=dpans11.htm><img src=left.gif 12 width=26 height=26 align=ALIGN border=0></a> 13 <a href=dpans13.htm><img src=right.gif 14 width=26 height=26 align=ALIGN border=0></a> 15 </td> 16 <td align=right> 17 <a href=dpans.htm#toc><img src=up.gif 18 width=26 height=26 align=ALIGN border=0></a> 19 <a name=12.>Table of Contents</a> 20 </td> 21 </tr> 22 </table> 23 <p> 24 <hr size=4> 25 26 <H1>12. The optional Floating-Point word set</H1> 27 28 <hr> 29 <A name=12.1> 30 <H2>12.1 Introduction</H2> 31 </a> 32 33 <p> 34 <code> 35 See: 36 <a href=dpansa12.htm#A.12>A.12</a> The optional Floating-Point word set 37 </code> 38 <p> 39 40 <hr> 41 <A name=12.2> 42 <H2>12.2 Additional terms and notation</H2> 43 </a> 44 45 46 <hr> 47 <A name=12.2.1> 48 <H3>12.2.1 Definition of terms</H3> 49 </a> 50 51 52 <DL> 53 <DT><B>float-aligned address:</B> 54 <DD>The address of a memory location at which a 55 floating-point number can be accessed. 56 57 <DT><B>double-float-aligned address:</B> 58 <DD>The address of a memory location at which 59 a 64-bit IEEE double-precision floating-point number can be accessed. 60 61 <DT><B>single-float-aligned address:</B> 62 <DD>The address of a memory location at which 63 a 32-bit IEEE single-precision floating-point number can be accessed. 64 65 <DT><B>IEEE floating-point number:</B> 66 <DD>A single- or double-precision floating-point 67 number as defined in ANSI/IEEE 754-1985.</DL> 68 69 70 <P> 71 72 <hr> 73 <A name=12.2.2> 74 <H3>12.2.2 Notation</H3> 75 </a> 76 77 78 <hr> 79 <A name=12.2.2.1> 80 <H4>12.2.2.1 Numeric notation</H4> 81 </a> 82 83 The following notation is used to define the syntax of the external 84 representation of floating-point numbers: 85 86 <UL> 87 <LI>Each component of a floating-point number is defined with a rule 88 consisting of the name of the component (italicized in angle-brackets, 89 e.g.,<I><sign></I> characters := and a concatenation of tokens and 90 metacharacters; 91 <LI>Tokens may be literal characters (in bold face, e.g.,<B>E</B>) or rule 92 names in angle brackets (e.g.,<digit>); 93 <LI>The metacharacter * is used to specify zero or more occurrences 94 of the preceding token (e.g.,<digit>*); 95 <LI>Tokens enclosed with [ and ] are optional (e.g.,[<sign>]); 96 <LI>Vertical bars separate choices from a list of tokens enclosed 97 with braces (e.g.,{ + | - }). 98 </UL> 99 100 <P> 101 102 <hr> 103 <A name=12.2.2.2> 104 <H4>12.2.2.2 Stack notation</H4> 105 </a> 106 107 Floating-point stack notation when the floating-point stack is separate 108 from the data stack is: 109 <P> 110 111 ( F: before -- after ) 112 <P> 113 114 115 <hr> 116 <A name=12.3> 117 <H2>12.3 Additional usage requirements</H2> 118 </a> 119 120 121 <hr> 122 <A name=12.3.1> 123 <H3>12.3.1 Data types</H3> 124 </a> 125 126 Append table 12.1 to 127 <a href=dpans3.htm#table.3.1>table 3.1</a>. 128 129 <P> 130 131 Table 12.1 - Data Types 132 <P> 133 134 135 136 <PRE> 137 Symbol Data type Size on stack 138 ------ --------- ------------- 139 r floating-point number implementation-defined 140 f-addr float-aligned address 1 cell 141 sf-addr single-float-aligned address 1 cell 142 df-addr double-float-aligned address 1 cell 143 </PRE> 144 145 146 <P> 147 148 <hr> 149 <A name=12.3.1.1> 150 <H4>12.3.1.1 Addresses</H4> 151 </a> 152 153 The set of float-aligned addresses is an implementation-defined subset 154 of the set of aligned addresses. Adding the size of a floating-point 155 number to a float-aligned address shall produce a float-aligned address. 156 157 <P> 158 159 The set of double-float-aligned addresses is an implementation-defined 160 subset of the set of aligned addresses. Adding the size of a 64-bit 161 IEEE double-precision floating-point number to a double-float-aligned 162 address shall produce a double-float-aligned address. 163 164 <P> 165 166 The set of single-float-aligned addresses is an implementation-defined 167 subset of the set of aligned addresses. Adding the size of a 32-bit 168 IEEE single-precision floating-point number to a single-float-aligned 169 address shall produce a single-float-aligned address. 170 171 <P> 172 173 <hr> 174 <A name=12.3.1.2> 175 <H4>12.3.1.2 Floating-point numbers</H4> 176 </a> 177 178 The internal representation of a floating-point number, including the 179 format and precision of the significand and the format and range of the 180 exponent, is implementation defined. 181 182 <P> 183 184 Any rounding or truncation of floating-point numbers is implementation 185 defined. 186 187 <P> 188 189 <hr> 190 <A name=12.3.2> 191 <H3>12.3.2 Floating-point operations</H3> 192 </a> 193 194 <B>Round to nearest</B> means round the result of a floating-point 195 operation to the representable value nearest the result. If the two 196 nearest representable values are equally near the result, the one having 197 zero as its least significant bit shall be delivered. 198 199 <P> 200 201 <B>Round toward negative infinity</B> means round the result of a 202 floating-point operation to the representable value nearest to and no 203 greater than the result. 204 205 <P> 206 207 <hr> 208 <A name=12.3.3> 209 <H3>12.3.3 Floating-point stack</H3> 210 </a> 211 212 A last in, first out list that shall be used by all floating-point 213 operators. 214 215 <P> 216 217 The width of the floating-point stack is implementation-defined. By 218 default the floating-point stack shall be separate from the data and 219 return stacks. A program may determine whether floating-point numbers 220 are kept on the data stack by passing the string 221 <a href=dpans12.htm#12.3.4>FLOATING-STACK</a> 222 to 223 <a href=dpans6.htm#6.1.1345>ENVIRONMENT?</a>. 224 225 <P> 226 227 The size 228 of a floating-point stack shall be at least 6 items. 229 230 <P> 231 232 A program that depends on the floating-point stack being larger than six 233 items has an environmental dependency. 234 235 <P> 236 237 <hr> 238 <A name=12.3.4> 239 <H3>12.3.4 Environmental queries</H3> 240 </a> 241 242 Append table 12.2 to 243 table 3.5. 244 245 <P> 246 247 <code> 248 See: 249 <A href=dpans3.htm#3.2.6>3.2.6</a> Environmental queries 250 </code> 251 <P> 252 253 Table 12.2 - Environmental query strings 254 <P> 255 256 257 258 <PRE> 259 String Value data type Constant? Meaning 260 ------ --------------- --------- ------- 261 FLOATING flag no floating-point word set present 262 FLOATING-EXT flag no floating-point extensions word set present 263 FLOATING-STACK n yes If n = zero, floating-point numbers are 264 kept on the data stack; otherwise n is 265 the maximum depth of the separate 266 floating-point stack. 267 MAX-FLOAT r yes largest usable floating-point number 268 269 </PRE> 270 271 <P> 272 273 <hr> 274 <A name=12.3.5> 275 <H3>12.3.5 Address alignment</H3> 276 </a> 277 278 Since the address returned by a 279 <a href=dpans6.htm#6.1.1000>CREATE</a>d word is not necessarily aligned 280 for any particular class of floating-point data, a program shall align 281 the address (to be float aligned, single-float aligned, or double-float 282 aligned) before accessing floating-point data at the address. 283 284 <P> 285 286 <code> 287 See: 288 <A href=dpans3.htm#3.3.3.1>3.3.3.1</a> Address alignment, 289 <a href=dpansa12.htm#A.12.3.5>A.12.3.5</a> Address alignment, 290 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses. 291 </code> 292 <P> 293 294 <hr> 295 <A name=12.3.6> 296 <H3>12.3.6 Variables</H3> 297 </a> 298 299 A program may address memory in data space regions made available by 300 <a href=dpans12.htm#12.6.1.1630>FVARIABLE</a>. 301 These regions may be non-contiguous with regions 302 subsequently allocated with , 303 (<a href=dpans6.htm#6.1.0150>comma</a>) or 304 <a href=dpans6.htm#6.1.0710>ALLOT</a>. 305 306 <P> 307 308 <code> 309 See: 310 <A href=dpans3.htm#3.3.3.3>3.3.3.3</a> Variables 311 </code> 312 <P> 313 314 315 <hr> 316 <A name=12.3.7> 317 <H3>12.3.7 Text interpreter input number conversion</H3> 318 </a> 319 320 If the Floating-Point word set is present in the dictionary and the 321 current base is 322 <a href=dpans6.htm#6.1.1170>DECIMAL</a>, 323 the input number-conversion algorithm shall be 324 extended to recognize floating-point numbers in this form: 325 326 <P> 327 328 Convertible string := <significand><exponent> 329 330 331 <PRE> 332 <significand> := [<sign>]<digits>[.<digits0>] 333 <exponent> := E[<sign>]<digits0> 334 <sign> := { + | - } 335 <digits> := <digit><digits0> 336 <digits0> := <digit>* 337 <digit> := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 } 338 </PRE> 339 <P> 340 341 These are examples of valid representations of floating-point numbers in 342 program source: 343 344 <PRE> 345 1E 1.E 1.E0 +1.23E-1 -1.23E+1 346 </PRE> 347 <P> 348 349 <code> 350 See: 351 <A href=dpans3.htm#3.4.1.3>3.4.1.3</a> Text interpreter input number 352 conversion, 353 <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a> Text interpreter input number conversion, 354 <A href=dpans12.htm#12.6.1.0558>12.6.1.0558 >FLOAT</a> 355 </code> 356 357 <P> 358 359 <hr> 360 <A name=12.4> 361 <H2>12.4 Additional documentation requirements</H2> 362 </a> 363 364 365 <hr> 366 <A name=12.4.1> 367 <H3>12.4.1 System documentation</H3> 368 </a> 369 370 371 <hr> 372 <A name=12.4.1.1> 373 <H4>12.4.1.1 Implementation-defined options</H4> 374 </a> 375 376 377 <UL> 378 <LI>format and range of floating-point numbers 379 (<a href=dpans12.htm#12.3.1>12.3.1</a> Data types, 380 <a href=dpans12.htm#12.6.1.2143>12.6.1.2143</a> REPRESENT); 381 <LI>results of 382 <a href=dpans12.htm#12.6.1.2143>12.6.1.2143</a> REPRESENT 383 when float is out of range; 384 <LI>rounding or truncation of floating-point numbers 385 (<a href=dpans12.htm#12.3.1.2>12.3.1.2</a> 386 Floating-point numbers); 387 <LI>size of floating-point stack 388 (<a href=dpans12.htm#12.3.3>12.3.3</a> Floating-point stack); 389 <LI>width of floating-point stack 390 (<a href=dpans12.htm#12.3.3>12.3.3</a> Floating-point stack). 391 </UL> 392 393 <P> 394 395 <hr> 396 <A name=12.4.1.2> 397 <H4>12.4.1.2 Ambiguous conditions</H4> 398 </a> 399 <P> 400 401 <UL> 402 <LI> 403 <a href=dpans12.htm#12.6.2.1204>DF@</a> or 404 <a href=dpans12.htm#12.6.2.1203>DF!</a> is 405 used with an address that is not double-float aligned; 406 <LI> 407 <a href=dpans12.htm#12.6.1.1472>F@</a> or 408 <a href=dpans12.htm#12.6.1.1400>F!</a> is 409 used with an address that is not float aligned; 410 <LI>FLOATing point result out of range (e.g., in 411 <a href=dpans12.htm#12.6.1.1430>12.6.1.1430</a> F/); 412 <LI> 413 <a href=dpans12.htm#12.6.2.2203>SF@</a> or 414 <a href=dpans12.htm#12.6.2.2202>SF!</a> is 415 used with an address that is not single-float aligned; 416 <LI> 417 <a href=dpans6.htm#6.1.0750>BASE</a> is not decimal 418 (<a href=dpans12.htm#12.6.1.2143>12.6.1.2143</a> REPRESENT, 419 <a href=dpans12.htm#12.6.2.1427>12.6.2.1427</a> F., 420 <a href=dpans12.htm#12.6.2.1513>12.6.2.1513</a> FE., 421 <a href=dpans12.htm#12.6.2.1613>12.6.2.1613</a> FS.); 422 <LI>both arguments equal zero 423 (<a href=dpans12.htm#12.6.2.1489>12.6.2.1489</a> FATAN2); 424 <LI>cosine of argument is zero for 425 <a href=dpans12.htm#12.6.2.1625>12.6.2.1625</a> FTAN; 426 <LI>d can't be precisely represented as float in 427 <a href=dpans12.htm#12.6.1.1130>12.6.1.1130</a> D>F; 428 <LI>dividing by zero 429 (<a href=dpans12.htm#12.6.1.1430>12.6.1.1430</a> F/); 430 <LI>exponent too big for conversion 431 (<a href=dpans12.htm#12.6.2.1203>12.6.2.1203</a> DF!, 432 <a href=dpans12.htm#12.6.2.1204>12.6.2.1204</a> DF@, 433 <a href=dpans12.htm#12.6.2.2202>12.6.2.2202</a> SF!, 434 <a href=dpans12.htm#12.6.2.2203>12.6.2.2203</a> SF@); 435 <LI>FLOAT less than one 436 (<a href=dpans12.htm#12.6.2.1477>12.6.2.1477</a> FACOSH); 437 <LI>FLOAT less than or equal to minus-one 438 (<a href=dpans12.htm#12.6.2.1554>12.6.2.1554</a> FLNP1); 439 <LI>FLOAT less than or equal to zero 440 (<a href=dpans12.htm#12.6.2.1553>12.6.2.1553</a> FLN, 441 <a href=dpans12.htm#12.6.2.1557>12.6.2.1557</a> FLOG); 442 <LI>FLOAT less than zero 443 (<a href=dpans12.htm#12.6.2.1487>12.6.2.1487</a> FASINH, 444 <a href=dpans12.htm#12.6.2.1618>12.6.2.1618</a> FSQRT); 445 <LI>FLOAT magnitude greater than one 446 (<a href=dpans12.htm#12.6.2.1476>12.6.2.1476</a> FACOS, 447 <a href=dpans12.htm#12.6.2.1486>12.6.2.1486</a> FASIN, 448 <a href=dpans12.htm#12.6.2.1491>12.6.2.1491</a> FATANH); 449 <LI>Integer part of float can't be represented by d in 450 <a href=dpans12.htm#12.6.1.1470>12.6.1.1470</a> F>D; 451 <LI>string larger than pictured-numeric output area 452 (<a href=dpans12.htm#12.6.2.1427>12.6.2.1427</a> F., 453 <a href=dpans12.htm#12.6.2.1513>12.6.2.1513</a> FE., 454 <a href=dpans12.htm#12.6.2.1613>12.6.2.1613</a> FS.). 455 </UL> 456 457 <P> 458 459 <hr> 460 <A name=12.4.1.3> 461 <H4>12.4.1.3 Other system documentation</H4> 462 </a> 463 464 <UL> 465 <LI>no additional requirements. 466 </UL> 467 <P> 468 469 <hr> 470 <A name=12.4.2> 471 <H3>12.4.2 Program documentation</H3> 472 </a> 473 474 475 <hr> 476 <A name=12.4.2.1> 477 <H4>12.4.2.1 Environmental dependencies</H4> 478 </a> 479 480 <UL> 481 <LI>requiring the floating-point stack to be larger than six items 482 (<a href=dpans12.htm#12.3.3>12.3.3</a> Floating-point stack). 483 </UL> 484 485 <P> 486 487 <hr> 488 <A name=12.4.2.2> 489 <H4>12.4.2.2 Other program documentation</H4> 490 </a> 491 492 <UL> 493 <LI>no additional requirements. 494 </UL> 495 496 <P> 497 498 <hr> 499 <A name=12.5> 500 <H2>12.5 Compliance and labeling</H2> 501 </a> 502 503 504 <hr> 505 <A name=12.5.1> 506 <H3>12.5.1 ANS Forth systems</H3> 507 </a> 508 509 The phrase <B>Providing the Floating-Point word set</B> shall be 510 appended to the label of any Standard System that provides all of the 511 Floating-Point word set. 512 513 <P> 514 515 The phrase <B>Providing name(s) from the Floating-Point Extensions word 516 set</B> shall be appended to the label of any Standard System that 517 provides portions of the Floating-Point Extensions word set. 518 519 <P> 520 521 The phrase <B>Providing the Floating-Point Extensions word set</B> shall 522 be appended to the label of any Standard System that provides all of the 523 Floating-Point and Floating-Point Extensions word sets. 524 525 <P> 526 527 <hr> 528 <A name=12.5.2> 529 <H3>12.5.2 ANS Forth programs</H3> 530 </a> 531 532 The phrase <B>Requiring the Floating-Point word set</B> shall be 533 appended to the label of Standard Programs that require the system to 534 provide the Floating-Point word set. 535 536 <P> 537 538 The phrase <B>Requiring name(s) from the Floating-Point Extensions word 539 set</B> shall be appended to the label of Standard Programs that require 540 the system to provide portions of the Floating-Point Extensions word 541 set. 542 543 <P> 544 545 The phrase <B>Requiring the Floating-Point Extensions word set</B> shall 546 be appended to the label of Standard Programs that require the system to 547 provide all of the Floating-Point and Floating-Point Extensions word 548 sets. 549 550 <P> 551 552 <hr> 553 <A name=12.6> 554 <H2>12.6 Glossary</H2> 555 </a> 556 557 558 <hr> 559 <A name=12.6.1> 560 <H3>12.6.1 Floating-Point words</H3> 561 </a> 562 563 564 565 <hr> 566 <A name=12.6.1.0558> 567 <code> 568 12.6.1.0558 <b>>FLOAT</b> 569 </code> 570 </a> 571 <BR> 572 <B>to-float</B> FLOATING 573 <BR> 574 <pre> 575 ( c-addr u -- true | false ) ( F: -- r | ) 576 or ( c-addr u -- r true | false) 577 </pre> 578 579 <P> 580 581 An attempt is made to convert the string specified by c-addr and u to 582 internal floating-point representation. If the string represents a 583 valid floating-point number in the syntax below, its value r and true 584 are returned. If the string does not represent a valid floating-point 585 number only false is returned. 586 587 <P> 588 589 A string of blanks should be treated as a special case representing 590 zero. 591 592 <P> 593 594 The syntax of a convertible string := <significand>[<exponent>] 595 596 <PRE> 597 <significand> := [<sign>]{<digits>[.<digits0>] | 598 .<digits> } 599 <exponent> := <marker><digits0> 600 <marker> := {<e-form> | <sign-form>} 601 <e-form> := <e-char>[<sign-form>] 602 <sign-form> := { + | - } 603 <e-char> := { D | d | E | e } 604 </PRE> 605 606 <p> 607 <code> 608 See: 609 <a href=dpansa12.htm#A.12.6.1.0558>A.12.6.1.0558 >FLOAT</a> 610 </code> 611 <p> 612 613 614 <hr> 615 <A name=12.6.1.1130> 616 <code> 617 12.6.1.1130 <b>D>F</b> 618 </code> 619 </a> 620 <BR> 621 <B>d-to-f</B> FLOATING 622 <BR> 623 <pre> 624 ( d -- ) ( F: -- r ) 625 or ( d -- r ) 626 </pre> 627 628 <P> 629 630 r is the floating-point equivalent of d. An ambiguous condition exists 631 if d cannot be precisely represented as a floating-point value. 632 633 <P> 634 635 <hr> 636 <A name=12.6.1.1400> 637 <code> 638 12.6.1.1400 <b>F!</b> 639 </code> 640 </a> 641 <BR> 642 <B>f-store</B> FLOATING 643 <BR> 644 <pre> 645 ( f-addr -- ) ( F: r -- ) 646 or ( r f-addr -- ) 647 </pre> 648 649 <P> 650 651 Store r at 652 f-addr. 653 654 <P> 655 656 <hr> 657 <A name=12.6.1.1410> 658 <code> 659 12.6.1.1410 <b>F*</b> 660 </code> 661 </a> 662 <BR> 663 <B>f-star</B> FLOATING 664 <BR> 665 <pre> 666 ( F: r1 r2 -- r3 ) 667 or ( r1 r2 -- r3 ) 668 </pre> 669 670 <P> 671 672 Multiply r1 673 by r2 giving r3. 674 675 <P> 676 677 <hr> 678 <A name=12.6.1.1420> 679 <code> 680 12.6.1.1420 <b>F+</b> 681 </code> 682 </a> 683 <BR> 684 <B>f-plus</B> FLOATING 685 <BR> 686 <pre> 687 ( F: r1 r2 -- r3 ) 688 or ( r1 r2 -- r3 ) 689 </pre> 690 691 <P> 692 693 Add r1 to r2 694 giving the sum r3. 695 696 <P> 697 698 <hr> 699 <A name=12.6.1.1425> 700 <code> 701 12.6.1.1425 <b>F-</b> 702 </code> 703 </a> 704 <BR> 705 <B>f-minus</B> FLOATING 706 <BR> 707 <pre> 708 ( F: r1 r2 -- r3 ) 709 or ( r1 r2 -- r3 ) 710 </pre> 711 712 <P> 713 714 Subtract r2 from r1, 715 giving r3. 716 717 <P> 718 719 <hr> 720 <A name=12.6.1.1430> 721 <code> 722 12.6.1.1430 <b>F/</b> 723 </code> 724 </a> 725 <BR> 726 <B>f-slash</B> FLOATING 727 <BR> 728 <pre> 729 ( F: r1 r2 -- r3 ) 730 or ( r1 r2 -- r3 ) 731 </pre> 732 733 <P> 734 735 Divide r1 by r2, giving the quotient r3. An ambiguous condition exists 736 if r2 is zero, or the quotient lies outside of the range of a 737 floating-point number. 738 739 <P> 740 741 <hr> 742 <A name=12.6.1.1440> 743 <code> 744 12.6.1.1440 <b>F0<</b> 745 </code> 746 </a> 747 <BR> 748 <B>f-zero-less-than</B> FLOATING 749 <BR> 750 <pre> 751 ( -- flag ) ( F: r -- ) 752 or ( r -- flag ) 753 </pre> 754 755 <P> 756 757 flag is true 758 if and only if r is less than zero. 759 760 <P> 761 762 <hr> 763 <A name=12.6.1.1450> 764 <code> 765 12.6.1.1450 <b>F0=</b> 766 </code> 767 </a> 768 <BR> 769 <B>f-zero-equals</B> FLOATING 770 <BR> 771 <pre> 772 ( -- flag ) ( F: r -- ) 773 or ( r -- flag ) 774 </pre> 775 776 <P> 777 778 flag is true 779 if and only if r is equal to zero. 780 781 <P> 782 783 <hr> 784 <A name=12.6.1.1460> 785 <code> 786 12.6.1.1460 <b>F<</b> 787 </code> 788 </a> 789 <BR> 790 <B>f-less-than</B> FLOATING 791 <BR> 792 <pre> 793 ( -- flag ) ( F: r1 r2 -- ) 794 or ( r1 r2 -- flag ) 795 </pre> 796 797 <P> 798 799 flag is true 800 <P> 801 if and only if r1 is less than 802 <P> 803 804 <hr> 805 <A name=12.6.1.1470> 806 <code> 807 12.6.1.1460 <b>F>D</b> 808 </code> 809 </a> 810 <BR> 811 <B>f-to-d</B> FLOATING 812 <BR> 813 <pre> 814 ( -- d ) ( F: r -- ) 815 or ( r -- d ) 816 </pre> 817 818 <P> 819 820 d is the double-cell signed-integer equivalent of the integer portion of 821 r. The fractional portion of r is discarded. An ambiguous condition 822 exists if the integer portion of r cannot be precisely represented as a 823 double-cell signed integer. 824 825 <P> 826 827 <hr> 828 <A name=12.6.1.1472> 829 <code> 830 12.6.1.1472 <b>F@</b> 831 </code> 832 </a> 833 <BR> 834 <B>f-fetch</B> FLOATING 835 <BR> 836 <pre> 837 ( f-addr -- ) ( F: -- r ) 838 or ( f-addr -- r ) 839 </pre> 840 841 <P> 842 843 r is 844 the value stored at f-addr. 845 846 <P> 847 848 <hr> 849 <A name=12.6.1.1479> 850 <code> 851 12.6.1.1479 <b>FALIGN</b> 852 </code> 853 </a> 854 <BR> 855 <B>f-align</B> FLOATING 856 <BR> 857 <pre> 858 ( -- ) 859 </pre> 860 861 <P> 862 863 If the data-space pointer is not float aligned, reserve enough data 864 space to make it so. 865 866 <P> 867 868 <hr> 869 <A name=12.6.1.1483> 870 <code> 871 12.6.1.1483 <b>FALIGNED</b> 872 </code> 873 </a> 874 <BR> 875 <B>f-aligned</B> FLOATING 876 <BR> 877 <pre> 878 ( addr -- f-addr ) 879 </pre> 880 <P> 881 882 f-addr is the first float-aligned address greater than or equal to addr. 883 <P> 884 885 <hr> 886 <A name=12.6.1.1492> 887 <code> 888 12.6.1.1492 <b>FCONSTANT</b> 889 </code> 890 </a> 891 <BR> 892 <B>f-constant</B> FLOATING 893 <BR> 894 <pre> 895 ( <B>"<spaces>name"</B> -- ) ( F: r -- ) 896 or ( r <B>"<spaces>name"</B> -- ) 897 </pre> 898 899 <P> 900 901 Skip leading space delimiters. Parse name delimited by a space. Create 902 a definition for name with the execution semantics defined below. 903 904 <P> 905 906 name is 907 referred to as an <B>f-constant</B>. 908 909 <PRE> 910 <i>name</i> Execution: ( -- ) ( F: -- r ) 911 or ( -- r ) 912 </PRE> 913 <P> 914 915 Place r 916 on the floating-point stack. 917 <P> 918 919 <code> 920 See: 921 <a href=dpansa12.htm#A.12.6.1.1492>A.12.6.1.1492 FCONSTANT</a> , 922 <A href=dpans3.htm#3.4.1>3.4.1</a> Parsing. 923 </code> 924 925 <P> 926 927 <hr> 928 <A name=12.6.1.1497> 929 <code> 930 12.6.1.1497 <b>FDEPTH</b> 931 </code> 932 </a> 933 <BR> 934 <B>f-depth</B> FLOATING 935 <BR> 936 <pre> 937 ( -- +n ) 938 </pre> 939 940 <P> 941 942 +n is the number of values contained on the default separate 943 floating-point stack. If floating-point numbers are kept on the data 944 stack, +n is the current number of possible floating-point values 945 contained on the data stack. 946 947 <P> 948 949 <hr> 950 <A name=12.6.1.1500> 951 <code> 952 12.6.1.1500 <b>FDROP</b> 953 </code> 954 </a> 955 <BR> 956 <B>f-drop</B> 957 <BR> 958 FLOATING 959 <pre> 960 ( F: r -- ) 961 or ( r -- ) 962 </pre> 963 964 <P> 965 966 Remove r 967 from the floating-point stack. 968 969 <P> 970 971 <hr> 972 <A name=12.6.1.1510> 973 <code> 974 12.6.1.1510 <b>FDUP</b> 975 </code> 976 </a> 977 <BR> 978 <B>f-dupe</B> FLOATING 979 <BR> 980 <pre> 981 ( F: r -- r r ) 982 or ( r -- r r ) 983 </pre> 984 985 <P> 986 987 Duplicate 988 r. 989 990 <P> 991 992 <hr> 993 <A name=12.6.1.1552> 994 <code> 995 12.6.1.1552 <b>FLITERAL</b> 996 </code> 997 </a> 998 <BR> 999 <B>f-literal</B> FLOATING 1000 <p> 1001 <pre> 1002 Interpretation: Interpretation semantics for this word are undefined. 1003 </pre> 1004 <PRE> 1005 Compilation: ( F: r -- ) 1006 or ( r -- ) 1007 </PRE> 1008 <P> 1009 1010 Append the run-time 1011 semantics given below to the current definition. 1012 1013 <PRE> 1014 Run-time: ( F: -- r ) 1015 or ( -- r ) 1016 </PRE> 1017 <P> 1018 1019 Place r 1020 on the floating-point stack. 1021 1022 <p> 1023 <code> 1024 See: 1025 <a href=dpansa12.htm#A.12.6.1.1552>A.12.6.1.1552 FLITERAL</a> 1026 </code> 1027 <p> 1028 1029 1030 <hr> 1031 <A name=12.6.1.1555> 1032 <code> 1033 12.6.1.1555 <b>FLOAT+</b> 1034 </code> 1035 </a> 1036 <BR> 1037 <B>FLOAT-plus</B> FLOATING 1038 <BR> 1039 <pre> 1040 ( f-addr1 -- f-addr2 ) 1041 </pre> 1042 1043 <P> 1044 1045 Add the size in address units of a floating-point number to f-addr1, 1046 giving f-addr2. 1047 1048 <P> 1049 1050 <hr> 1051 <A name=12.6.1.1556> 1052 <code> 1053 12.6.1.1556 <b>FLOATS</b> 1054 </code> 1055 </a> 1056 <BR> 1057 FLOATING 1058 <BR> 1059 <pre> 1060 ( n1 -- n2 ) 1061 </pre> 1062 1063 <P> 1064 1065 n2 is the 1066 size in address units of n1 floating-point numbers. 1067 1068 <P> 1069 1070 <hr> 1071 <A name=12.6.1.1558> 1072 <code> 1073 12.6.1.1558 <b>FLOOR</b> 1074 </code> 1075 </a> 1076 <BR> 1077 FLOATING 1078 <BR> 1079 <pre> 1080 ( F: r1 -- r2 ) 1081 or ( r1 -- r2 ) 1082 </pre> 1083 1084 <P> 1085 1086 Round r1 to an integral value using the <B>round toward negative 1087 infinity</B> rule, giving r2. 1088 1089 <P> 1090 1091 <hr> 1092 <A name=12.6.1.1562> 1093 <code> 1094 12.6.1.1562 <b>FMAX</b> 1095 </code> 1096 </a> 1097 <BR> 1098 <B>f-max</B> FLOATING 1099 <BR> 1100 <pre> 1101 ( F: r1 r2 -- r3 ) 1102 or ( r1 r2 -- r3 ) 1103 </pre> 1104 1105 <P> 1106 1107 r3 is 1108 the greater of r1 and r2. 1109 1110 <P> 1111 1112 <hr> 1113 <A name=12.6.1.1565> 1114 <code> 1115 12.6.1.1565 <b>FMIN</b> 1116 </code> 1117 </a> 1118 <BR> 1119 <B>f-min</B> FLOATING 1120 <BR> 1121 <pre> 1122 ( F: r1 r2 -- r3 ) 1123 or ( r1 r2 -- r3 ) 1124 </pre> 1125 1126 <P> 1127 1128 r3 is 1129 the lesser of r1 and r2. 1130 1131 <P> 1132 1133 <hr> 1134 <A name=12.6.1.1567> 1135 <code> 1136 12.6.1.1567 <b>FNEGATE</b> 1137 </code> 1138 </a> 1139 <BR> 1140 <B>f-negate</B> FLOATING 1141 <BR> 1142 <pre> 1143 ( F: r1 -- r2 ) 1144 or ( r1 -- r2 ) 1145 </pre> 1146 1147 <P> 1148 1149 r2 is 1150 the negation of r1. 1151 1152 <P> 1153 1154 <hr> 1155 <A name=12.6.1.1600> 1156 <code> 1157 12.6.1.1600 <b>FOVER</b> 1158 </code> 1159 </a> 1160 <BR> 1161 <B>f-over</B> FLOATING 1162 <BR> 1163 <pre> 1164 ( F: r1 r2 -- r1 r2 r1 ) 1165 or ( r1 r2 -- r1 r2 r1 ) 1166 </pre> 1167 1168 <P> 1169 1170 Place a 1171 copy of r1 on top of the floating-point stack. 1172 1173 <P> 1174 1175 <hr> 1176 <A name=12.6.1.1610> 1177 <code> 1178 12.6.1.1610 <b>FROT</b> 1179 </code> 1180 </a> 1181 <BR> 1182 <B>f-rote</B> FLOATING 1183 <BR> 1184 <pre> 1185 ( F: r1 r2 r3 -- r2 r3 r1 ) 1186 or ( r1 r2 r3 -- r2 r3 r1 ) 1187 </pre> 1188 1189 <P> 1190 1191 Rotate the 1192 top three floating-point stack entries. 1193 1194 <P> 1195 1196 <hr> 1197 <A name=12.6.1.1612> 1198 <code> 1199 12.6.1.1612 <b>FROUND</b> 1200 </code> 1201 </a> 1202 <BR> 1203 <B>f-round</B> FLOATING 1204 <BR> 1205 <pre> 1206 ( F: r1 -- r2 ) 1207 or ( r1 -- r2 ) 1208 </pre> 1209 1210 <P> 1211 1212 Round r1 to 1213 an integral value using the <B>round to nearest</B> rule, giving r2. 1214 <P> 1215 1216 <code> 1217 See: 1218 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations 1219 </code> 1220 1221 <P> 1222 1223 <hr> 1224 <A name=12.6.1.1620> 1225 <code> 1226 12.6.1.1620 <b>FSWAP</b> 1227 </code> 1228 </a> 1229 <BR> 1230 <B>f-swap</B> FLOATING 1231 <BR> 1232 <pre> 1233 ( F: r1 r2 -- r2 r1 ) 1234 or ( r1 r2 -- r2 r1 ) 1235 </pre> 1236 1237 <P> 1238 1239 Exchange the 1240 top two floating-point stack items. 1241 1242 <P> 1243 1244 <hr> 1245 <A name=12.6.1.1630> 1246 <code> 1247 12.6.1.1630 <b>FVARIABLE</b> 1248 </code> 1249 </a> 1250 <BR> 1251 <B>f-variable</B> FLOATING 1252 <BR> 1253 <pre> 1254 ( <B>"<spaces>name"</B> -- ) 1255 </pre> 1256 1257 <P> 1258 1259 Skip leading space delimiters. Parse name delimited by a space. Create 1260 a definition for name with the execution semantics defined below. 1261 Reserve 1 1262 <a href=dpans12.htm#12.6.1.1556>FLOATS</a> 1263 address units of data space at a float-aligned address. 1264 1265 <P> 1266 1267 name is 1268 referred to as an <B>f-variable</B>. 1269 1270 <PRE> 1271 <i>name</i> Execution: ( -- f-addr ) 1272 </PRE> 1273 <P> 1274 1275 f-addr is the address of the data space reserved by FVARIABLE when it 1276 created name. A program is responsible for initializing the contents of 1277 the reserved space. 1278 <P> 1279 1280 <code> 1281 See: 1282 <a href=dpansa12.htm#A.12.6.1.1630>A.12.6.1.1630 FVARIABLE</a> , 1283 <A href=dpans3.htm#3.4.1>3.4.1</a> Parsing. 1284 </code> 1285 1286 <P> 1287 1288 <hr> 1289 <A name=12.6.1.2143> 1290 <code> 1291 12.6.1.2143 <b>REPRESENT</b> 1292 </code> 1293 </a> 1294 <BR> 1295 FLOATING 1296 <BR> 1297 <pre> 1298 ( c-addr u -- n flag1 flag2 ) (F: r -- ) 1299 or ( r c-addr u -- n flag1 flag2 ) 1300 </pre> 1301 1302 <P> 1303 1304 At c-addr, place the character-string external representation of the 1305 significand of the floating-point number r. Return the decimal-base 1306 exponent as n, the sign as flag1 and <B>valid result</B> as flag2. The 1307 character string shall consist of the u most significant digits of the 1308 significand represented as a decimal fraction with the implied decimal 1309 point to the left of the first digit, and the first digit zero only if 1310 all digits are zero. The significand is rounded to u digits following 1311 the <B>round to nearest</B> rule; n is adjusted, if necessary, to 1312 correspond to the rounded magnitude of the significand. If flag2 is 1313 true then r was in the implementation-defined range of floating-point 1314 numbers. If flag1 is true then r is negative. 1315 1316 <P> 1317 1318 An ambiguous condition exists 1319 if the value of 1320 <a href=dpans6.htm#6.1.0750>BASE</a> is not decimal ten. 1321 1322 <P> 1323 1324 When flag2 is false, n and flag1 are implementation defined, as are the 1325 contents of c-addr. Under these circumstances, the string at c-addr 1326 shall consist of graphic characters. 1327 1328 <P> 1329 1330 <code> 1331 See: 1332 <A href=dpans3.htm#3.2.1.2>3.2.1.2</a> Digit conversion, 1333 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations, 1334 <a href=dpansa12.htm#A.12.6.1.2143>A.12.6.1.2143 REPRESENT</a> 1335 </code> 1336 <P> 1337 1338 1339 <hr> 1340 <a name=12.6.2> 1341 <H3>12.6.2 Floating-Point extension words</H3> 1342 </a> 1343 1344 1345 <hr> 1346 <A name=12.6.2.1203> 1347 <code> 1348 12.6.2.1203 <b>DF!</b> 1349 </code> 1350 </a> 1351 <BR> 1352 <B>d-f-store</B> FLOATING EXT 1353 <BR> 1354 <pre> 1355 ( df-addr -- ) ( F: r -- ) 1356 or ( r df-addr -- ) 1357 </pre> 1358 1359 <P> 1360 1361 Store the floating-point number r as a 64-bit IEEE double-precision 1362 number at df-addr. If the significand of the internal representation of 1363 r has more precision than the IEEE double-precision format, it will be 1364 rounded using the <B>round to nearest</B> rule. An ambiguous condition 1365 exists if the exponent of r is too large to be accommodated in IEEE 1366 double-precision format. 1367 <p> 1368 1369 <code> 1370 See: 1371 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses, 1372 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations. 1373 </code> 1374 1375 <P> 1376 1377 <hr> 1378 <A name=12.6.2.1204> 1379 <code> 1380 12.6.2.1204 <b>DF@</b> 1381 </code> 1382 </a> 1383 <BR> 1384 <B>d-f-fetch</B> FLOATING EXT 1385 <BR> 1386 <pre> 1387 ( df-addr -- ) ( F: -- r ) 1388 or ( df-addr -- r ) 1389 </pre> 1390 1391 <P> 1392 1393 Fetch the 64-bit IEEE double-precision number stored at df-addr to the 1394 floating-point stack as r in the internal representation. If the IEEE 1395 double-precision significand has more precision than the internal 1396 representation it will be rounded to the internal representation using 1397 the <B>round to nearest</B> rule. An ambiguous condition exists if the 1398 exponent of the IEEE double-precision representation is too large to be 1399 accommodated by the internal representation. 1400 <p> 1401 1402 <code> 1403 See: 1404 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses, 1405 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations. 1406 </code> 1407 1408 <P> 1409 1410 <hr> 1411 <A name=12.6.2.1205> 1412 <code> 1413 12.6.2.1205 <b>DFALIGN</b> 1414 </code> 1415 </a> 1416 <BR> 1417 <B>d-f-align</B> FLOATING EXT 1418 <BR> 1419 <pre> 1420 ( -- ) 1421 </pre> 1422 1423 <P> 1424 1425 If the data-space pointer is not double-float aligned, reserve enough 1426 data space to make it so. 1427 <P> 1428 1429 <code> 1430 See: 1431 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 1432 </code> 1433 1434 <P> 1435 1436 <hr> 1437 <A name=12.6.2.1207> 1438 <code> 1439 12.6.2.1207 <b>DFALIGNED</b> 1440 </code> 1441 </a> 1442 <BR> 1443 <B>d-f-aligned</B> FLOATING EXT 1444 <BR> 1445 <pre> 1446 ( addr -- df-addr ) 1447 </pre> 1448 1449 <P> 1450 1451 df-addr is the first double-float-aligned address greater than or equal 1452 to addr. 1453 <P> 1454 1455 <code> 1456 See: 1457 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 1458 </code> 1459 1460 <P> 1461 1462 <hr> 1463 <A name=12.6.2.1208> 1464 <code> 1465 12.6.2.1208 <b>DFLOAT+</b> 1466 </code> 1467 </a> 1468 <BR> 1469 <B>d-float-plus</B> FLOATING EXT 1470 <BR> 1471 <pre> 1472 ( df-addr1 -- df-addr2 ) 1473 </pre> 1474 1475 <P> 1476 1477 Add the size in address units of a 64-bit IEEE double-precision number 1478 to df-addr1, giving df-addr2. 1479 <P> 1480 1481 <code> 1482 See: 1483 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 1484 </code> 1485 1486 <P> 1487 1488 <hr> 1489 <A name=12.6.2.1209> 1490 <code> 1491 2.6.2.1209 <b>DFLOATS</b> 1492 </code> 1493 </a> 1494 <BR> 1495 <B>d-floats</B> FLOATING EXT 1496 <BR> 1497 <pre> 1498 ( n1 -- n2 ) 1499 </pre> 1500 1501 <P> 1502 1503 n2 is the size in address units of n1 64-bit IEEE double-precision 1504 numbers. 1505 1506 <P> 1507 1508 <hr> 1509 <A name=12.6.2.1415> 1510 <code> 1511 12.6.2.1415 <b>F**</b> 1512 </code> 1513 </a> 1514 <BR> 1515 <B>f-star-star</B> FLOATING EXT 1516 <BR> 1517 <pre> 1518 ( F: r1 r2 -- r3 ) 1519 or ( r1 r2 -- r3 ) 1520 </pre> 1521 1522 <P> 1523 1524 Raise r1 to 1525 the power r2, giving the product r3. 1526 1527 <P> 1528 1529 <hr> 1530 <A name=12.6.2.1427> 1531 <code> 1532 12.6.2.1427 <b>F.</b> 1533 </code> 1534 </a> 1535 <BR> 1536 <B>f-dot</B> FLOATING EXT 1537 <BR> 1538 <pre> 1539 ( -- ) ( F: r -- ) 1540 or ( r -- ) 1541 </pre> 1542 1543 <P> 1544 1545 Display, with a trailing space, the top number on the floating-point 1546 stack using fixed-point notation: 1547 1548 <PRE> 1549 [-] <digits>.<digits0> 1550 </PRE> 1551 <P> 1552 1553 An ambiguous condition exists if the value of 1554 <a href=dpans6.htm#6.1.0750>BASE</a> is not (decimal) ten 1555 or if the character string representation exceeds the size of the 1556 pictured numeric output string buffer. 1557 <P> 1558 1559 <code> 1560 See: 1561 <A href=dpans12.htm#12.6.1.0558>12.6.1.0558 >FLOAT</a> , 1562 <a href=dpansa12.htm#A.12.6.1.1427>A.12.6.1.1427 F.</a> 1563 </code> 1564 1565 <P> 1566 1567 <hr> 1568 <A name=12.6.2.1474> 1569 <code> 1570 12.6.2.1474 <b>FABS</b> 1571 </code> 1572 </a> 1573 <BR> 1574 <B>f-abs</B> FLOATING EXT 1575 <BR> 1576 <pre> 1577 ( F: r1 -- r2 ) 1578 or ( r1 -- r2 ) 1579 </pre> 1580 1581 <P> 1582 1583 r2 is 1584 the absolute value of r1. 1585 1586 <P> 1587 1588 <hr> 1589 <A name=12.6.2.1476> 1590 <code> 1591 12.6.2.1476 <b>FACOS</b> 1592 </code> 1593 </a> 1594 <BR> 1595 <B>f-a-cos</B> FLOATING EXT 1596 <BR> 1597 <pre> 1598 ( F: r1 -- r2 ) 1599 or ( r1 -- r2 ) 1600 </pre> 1601 1602 <P> 1603 1604 r2 is the principal radian angle whose cosine is r1. An ambiguous 1605 condition exists if |r1| is greater than one. 1606 1607 <P> 1608 1609 <hr> 1610 <A name=12.6.2.1477> 1611 <code> 1612 12.6.2.1477 <b>FACOSH</b> 1613 </code> 1614 </a> 1615 <BR> 1616 <B>f-a-cosh</B> FLOATING EXT 1617 <BR> 1618 <pre> 1619 ( F: r1 -- r2 ) 1620 or ( r1 -- r2 ) 1621 </pre> 1622 1623 <P> 1624 1625 r2 is the floating-point value whose hyperbolic cosine is r1. An 1626 ambiguous condition exists if r1 is less than one. 1627 1628 <P> 1629 1630 <hr> 1631 <A name=12.6.2.1484> 1632 <code> 1633 12.6.2.1484 <b>FALOG</b> 1634 </code> 1635 </a> 1636 <BR> 1637 <B>f-a-log</B> FLOATING EXT 1638 <BR> 1639 <pre> 1640 ( F: r1 -- r2 ) 1641 or ( r1 -- r2 ) 1642 </pre> 1643 1644 <P> 1645 1646 Raise ten 1647 to the power r1, giving r2. 1648 1649 <P> 1650 1651 <hr> 1652 <A name=12.6.2.1486> 1653 <code> 1654 12.6.2.1486 <b>FASIN</b> 1655 </code> 1656 </a> 1657 <BR> 1658 <B>f-a-sine</B> FLOATING EXT 1659 <BR> 1660 <pre> 1661 ( F: r1 -- r2 ) 1662 or ( r1 -- r2 ) 1663 </pre> 1664 1665 <P> 1666 1667 r2 is the principal radian angle whose sine is r1. An ambiguous 1668 condition exists if |r1| is greater than one. 1669 1670 <P> 1671 1672 <hr> 1673 <A name=12.6.2.1487> 1674 <code> 1675 12.6.2.1487 <b>FASINH</b> 1676 </code> 1677 </a> 1678 <BR> 1679 <B>f-a-cinch</B> FLOATING EXT 1680 <BR> 1681 <pre> 1682 ( F: r1 -- r2 ) 1683 or ( r1 -- r2 ) 1684 </pre> 1685 1686 <P> 1687 1688 r2 is the floating-point value whose hyperbolic sine is r1. An 1689 ambiguous condition exists if r1 is less than zero. 1690 1691 <P> 1692 1693 <hr> 1694 <A name=12.6.2.1488> 1695 <code> 1696 12.6.2.1488 <b>FATAN</b> 1697 </code> 1698 </a> 1699 <BR> 1700 <B>f-a-tan</B> FLOATING EXT 1701 <BR> 1702 <pre> 1703 ( F: r1 -- r2 ) 1704 or ( r1 -- r2 ) 1705 </pre> 1706 1707 <P> 1708 1709 r2 is 1710 the principal radian angle whose tangent is r1. 1711 1712 <P> 1713 1714 <hr> 1715 <A name=12.6.2.1489> 1716 <code> 1717 12.6.2.1489 <b>FATAN2</b> 1718 </code> 1719 </a> 1720 <BR> 1721 <B>f-a-tan-two</B> FLOATING EXT 1722 <BR> 1723 <pre> 1724 ( F: r1 r2 -- r3 ) 1725 or ( r1 r2 -- r3 ) 1726 </pre> 1727 1728 <P> 1729 1730 r3 is the radian angle whose tangent is r1/r2. An ambiguous condition 1731 exists if r1 and r2 are zero. 1732 1733 <p> 1734 <code> 1735 See: 1736 <a href=dpansa12.htm#A.12.6.2.1489>A.12.6.2.1489 FATAN2</a> 1737 </code> 1738 <p> 1739 1740 1741 <hr> 1742 <A name=12.6.2.1491> 1743 <code> 1744 12.6.2.1491 <b>FATANH</b> 1745 </code> 1746 </a> 1747 <BR> 1748 <B>f-a-tan-h</B> FLOATING EXT 1749 <BR> 1750 <pre> 1751 ( F: r1 -- r2 ) 1752 or ( r1 -- r2 ) 1753 </pre> 1754 1755 <P> 1756 1757 r2 is the floating-point value whose hyperbolic tangent is r1. An 1758 ambiguous condition exists if r1 is outside the range of -1E0 to 1E0. 1759 1760 <P> 1761 1762 <hr> 1763 <A name=12.6.2.1493> 1764 <code> 1765 12.6.2.1493 <b>FCOS</b> 1766 </code> 1767 </a> 1768 <BR> 1769 <B>f-cos</B> FLOATING EXT 1770 <BR> 1771 <pre> 1772 ( F: r1 -- r2 ) 1773 or ( r1 -- r2 ) 1774 </pre> 1775 1776 <P> 1777 1778 r2 is the 1779 cosine of the radian angle r1. 1780 1781 <P> 1782 1783 <hr> 1784 <A name=12.6.2.1494> 1785 <code> 1786 12.6.2.1494 <b>FCOSH</b> 1787 </code> 1788 </a> 1789 <BR> 1790 <B>f-cosh</B> FLOATING EXT 1791 <BR> 1792 <pre> 1793 ( F: r1 -- r2 ) 1794 or ( r1 -- r2 ) 1795 </pre> 1796 1797 <P> 1798 1799 r2 is 1800 the hyperbolic cosine of r1. 1801 1802 <P> 1803 1804 <hr> 1805 <A name=12.6.2.1513> 1806 <code> 1807 12.6.2.1513 <b>FE.</b> 1808 </code> 1809 </a> 1810 <BR> 1811 <B>f-e-dot</B> FLOATING EXT 1812 <BR> 1813 <pre> 1814 ( -- ) ( F: r -- ) 1815 or ( r -- ) 1816 </pre> 1817 1818 <P> 1819 1820 Display, with a trailing space, the top number on the floating-point 1821 stack using engineering notation, where the significand is greater than 1822 or equal to 1.0 and less than 1000.0 and the decimal exponent is a 1823 multiple of three. 1824 1825 <P> 1826 1827 An ambiguous condition exists if the value of 1828 <a href=dpans6.htm#6.1.0750>BASE</a> is not (decimal) ten 1829 or if the character string representation exceeds the size of the 1830 pictured numeric output string buffer. 1831 1832 <P> 1833 1834 <code> 1835 See: 1836 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations, 1837 <A href=dpans12.htm#12.6.1.2143>12.6.1.2143 REPRESENT</a> 1838 </code> 1839 1840 <P> 1841 1842 <hr> 1843 <A name=12.6.2.1515> 1844 <code> 1845 12.6.2.1515 <b>FEXP</b> 1846 </code> 1847 </a> 1848 <BR> 1849 <B>f-e-x-p</B> FLOATING EXT 1850 <BR> 1851 <pre> 1852 ( F: r1 -- r2 ) 1853 or ( r1 -- r2 ) 1854 </pre> 1855 1856 <P> 1857 1858 Raise e to the power r1, giving r2. 1859 1860 <P> 1861 1862 <hr> 1863 <A name=12.6.2.1516> 1864 <code> 1865 12.6.2.1516 <b>FEXPM1</b> 1866 </code> 1867 </a> 1868 <BR> 1869 <B>f-e-x-p-m-one</B> FLOATING EXT 1870 <BR> 1871 <pre> 1872 ( F: r1 -- r2 ) 1873 or ( r1 -- r2 ) 1874 </pre> 1875 1876 <P> 1877 1878 Raise e 1879 to the power r1 and subtract one, giving r2. 1880 1881 <p> 1882 <code> 1883 See: 1884 <a href=dpansa12.htm#A.12.6.2.1516>A.12.6.2.1516 FEXPM1</a> 1885 </code> 1886 <p> 1887 1888 1889 <hr> 1890 <A name=12.6.2.1553> 1891 <code> 1892 12.6.2.1553 <b>FLN</b> 1893 </code> 1894 </a> 1895 <BR> 1896 <B>f-l-n</B> FLOATING EXT 1897 <BR> 1898 <pre> 1899 ( F: r1 -- r2 ) 1900 or ( r1 -- r2 ) 1901 </pre> 1902 1903 <P> 1904 1905 r2 is the natural logarithm of r1. An ambiguous condition exists if r1 1906 is less than or equal to zero. 1907 1908 <P> 1909 1910 <hr> 1911 <A name=12.6.2.1554> 1912 <code> 1913 12.6.2.1554 <b>FLNP1</b> 1914 </code> 1915 </a> 1916 <BR> 1917 <B>f-l-n-p-one</B> FLOATING EXT 1918 <BR> 1919 <pre> 1920 ( F: r1 -- r2 ) 1921 or ( r1 -- r2 ) 1922 </pre> 1923 1924 <P> 1925 1926 r2 is the natural logarithm of the quantity r1 plus one. An ambiguous 1927 condition exists if r1 is less than or equal to negative one. 1928 1929 <p> 1930 <code> 1931 See: 1932 <a href=dpansa12.htm#A.12.6.2.1554>A.12.6.2.1554 FLNP1</a> 1933 </code> 1934 <p> 1935 1936 1937 <hr> 1938 <A name=12.6.2.1557> 1939 <code> 1940 12.6.2.1557 <b>FLOG</b> 1941 </code> 1942 </a> 1943 <BR> 1944 <B>f-log</B> FLOATING EXT 1945 <BR> 1946 <pre> 1947 ( F: r1 -- r2 ) 1948 or ( r1 -- r2 ) 1949 </pre> 1950 1951 <P> 1952 1953 r2 is the base-ten logarithm of r1. An ambiguous condition exists if r1 1954 is less than or equal to zero. 1955 1956 <P> 1957 1958 <hr> 1959 <A name=12.6.2.1613> 1960 <code> 1961 12.6.2.1613 <b>FS.</b> 1962 </code> 1963 </a> 1964 <BR> 1965 <B>f-s-dot</B> FLOATING EXT 1966 <BR> 1967 <pre> 1968 ( -- ) ( F: r -- ) 1969 or ( r -- ) 1970 </pre> 1971 1972 <P> 1973 1974 Display, with a trailing space, the top number on the floating-point 1975 stack in scientific notation: 1976 1977 <PRE> 1978 <significand><exponent> 1979 </PRE> 1980 <P> 1981 1982 where: 1983 <P> 1984 1985 1986 <PRE> 1987 <significand> := [-]<digit>.<digits0> 1988 <exponent> := E[-]<digits> 1989 </PRE> 1990 <P> 1991 1992 An ambiguous condition exists if the value of 1993 <a href=dpans6.htm#6.1.0750>BASE</a> is not (decimal) ten 1994 or if the character string representation exceeds the size of the 1995 pictured numeric output string buffer. 1996 1997 <P> 1998 1999 <code> 2000 See: 2001 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations, 2002 <A href=dpans12.htm#12.6.1.2143>12.6.1.2143 REPRESENT</a> 2003 </code> 2004 2005 <P> 2006 2007 <hr> 2008 <A name=12.6.2.1614> 2009 <code> 2010 12.6.2.1614 <b>FSIN</b> 2011 </code> 2012 </a> 2013 <BR> 2014 <B>f-sine</B> FLOATING EXT 2015 <BR> 2016 <pre> 2017 ( F: r1 -- r2 ) 2018 or ( r1 -- r2 ) 2019 </pre> 2020 2021 <P> 2022 2023 r2 is 2024 the sine of the radian angle r1. 2025 2026 <P> 2027 2028 <hr> 2029 <A name=12.6.2.1616> 2030 <code> 2031 12.6.2.1616 <b>FSINCOS</b> 2032 </code> 2033 </a> 2034 <BR> 2035 <B>f-sine-cos</B> FLOATING EXT 2036 <BR> 2037 <pre> 2038 ( F: r1 -- r2 r3 ) 2039 or ( r1 -- r2 r3 ) 2040 </pre> 2041 2042 <P> 2043 2044 r2 is the sine of the radian angle r1. r3 is the cosine of the radian 2045 angle r1. 2046 2047 <p> 2048 <code> 2049 See: 2050 <a href=dpansa12.htm#A.12.6.2.1489>A.12.6.2.1489 FATAN2</a> 2051 </code> 2052 <p> 2053 2054 2055 <hr> 2056 <A name=12.6.2.1617> 2057 <code> 2058 12.6.2.1617 <b>FSINH</b> 2059 </code> 2060 </a> 2061 <BR> 2062 <B>f-cinch</B> FLOATING EXT 2063 <BR> 2064 <pre> 2065 ( F: r1 -- r2 ) 2066 or ( r1 -- r2 ) 2067 </pre> 2068 2069 <P> 2070 2071 r2 is 2072 the hyperbolic sine of r1. 2073 2074 <P> 2075 2076 <hr> 2077 <A name=12.6.2.1618> 2078 <code> 2079 12.6.2.1618 <b>FSQRT</b> 2080 </code> 2081 </a> 2082 <BR> 2083 <B>f-square-root</B> FLOATING EXT 2084 <BR> 2085 <pre> 2086 ( F: r1 -- r2 ) 2087 or ( r1 -- r2 ) 2088 </pre> 2089 2090 <P> 2091 2092 r2 is the square root of r1. An ambiguous condition exists if r1 is 2093 less than zero. 2094 2095 <P> 2096 2097 <hr> 2098 <A name=12.6.2.1625> 2099 <code> 2100 12.6.2.1625 <b>FTAN</b> 2101 </code> 2102 </a> 2103 <BR> 2104 <B>f-tan</B> FLOATING EXT 2105 <BR> 2106 <pre> 2107 ( F: r1 -- r2 ) 2108 or ( r1 -- r2 ) 2109 </pre> 2110 2111 <P> 2112 2113 r2 is the tangent of the radian angle r1. An ambiguous condition exists 2114 if cos(r1) is zero. 2115 2116 <P> 2117 2118 <hr> 2119 <A name=12.6.2.1626> 2120 <code> 2121 12.6.2.1626 <b>FTANH</b> 2122 </code> 2123 </a> 2124 <BR> 2125 <B>f-tan-h</B> FLOATING EXT 2126 <BR> 2127 <pre> 2128 ( F: r1 -- r2 ) 2129 or ( r1 -- r2 ) 2130 </pre> 2131 2132 <P> 2133 2134 r2 is 2135 the hyperbolic tangent of r1. 2136 2137 <P> 2138 2139 <hr> 2140 <A name=12.6.2.1640> 2141 <code> 2142 12.6.2.1640 <b>F~</b> 2143 </code> 2144 </a> 2145 <BR> 2146 <B>f-proximate</B> FLOATING EXT 2147 <BR>( 2148 <pre> 2149 ( -- flag ) ( F: r1 r2 r3 -- ) 2150 or ( r1 r2 r3 -- flag ) 2151 </pre> 2152 2153 <P> 2154 2155 If r3 is positive, flag is true if the absolute value of (r1 minus r2) 2156 is less than r3. 2157 2158 <P> 2159 2160 If r3 is zero, flag is true if the implementation-dependent encoding of 2161 r1 and r2 are exactly identical (positive and negative zero are unequal 2162 if they have distinct encodings). 2163 2164 <P> 2165 2166 If r3 is negative, flag is true if the absolute value of (r1 minus r2) 2167 is less than the absolute value of r3 times the sum of the absolute 2168 values of r1 and r2. 2169 2170 <p> 2171 <code> 2172 See: 2173 <a href=dpansa12.htm#A.12.6.2.1640>A.12.6.2.1640 F~</a> 2174 </code> 2175 <p> 2176 2177 2178 <hr> 2179 <A name=12.6.2.2035> 2180 <code> 2181 12.6.2.2035 <b>PRECISION</b> 2182 </code> 2183 </a> 2184 <BR> 2185 FLOATING EXT 2186 <BR> 2187 <pre> 2188 ( -- u ) 2189 </pre> 2190 2191 <P> 2192 2193 Return the number of significant digits currently used by 2194 <a href=dpans12.htm#12.6.2.1427>F.</a>, 2195 <a href=dpans12.htm#12.6.2.1513>FE.</a>, or 2196 <a href=dpans12.htm#12.6.2.1613>FS.</a> as u. 2197 2198 <P> 2199 2200 <hr> 2201 <A name=12.6.2.2200> 2202 <code> 2203 12.6.2.2200 <b>SET-PRECISION</b> 2204 </code> 2205 </a> 2206 <BR> 2207 FLOATING EXT 2208 <BR> 2209 <pre> 2210 ( u -- ) 2211 </pre> 2212 2213 <P> 2214 2215 Set the number of significant digits currently used by 2216 <a href=dpans12.htm#12.6.2.1427>F.</a>, 2217 <a href=dpans12.htm#12.6.2.1513>FE.</a>, or 2218 <a href=dpans12.htm#12.6.2.1613>FS.</a> to u. 2219 2220 <P> 2221 2222 <hr> 2223 <A name=12.6.2.2202> 2224 <code> 2225 12.6.2.2202 <b>SF!</b> 2226 </code> 2227 </a> 2228 <BR> 2229 <B>s-f-store</B> FLOATING EXT 2230 <BR> 2231 <pre> 2232 ( sf-addr -- ) ( F: r -- ) 2233 or ( r sf-addr -- ) 2234 </pre> 2235 2236 <P> 2237 2238 Store the floating-point number r as a 32-bit IEEE single-precision 2239 number at sf-addr. If the significand of the internal representation of 2240 r has more precision than the IEEE single-precision format, it will be 2241 rounded using the <B>round to nearest</B> rule. An ambiguous condition 2242 exists if the exponent of r is too large to be accommodated by the IEEE 2243 single-precision format. 2244 <p> 2245 2246 <code> 2247 See: 2248 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses, 2249 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations. 2250 </code> 2251 2252 <P> 2253 2254 <hr> 2255 <A name=12.6.2.2203> 2256 <code> 2257 12.6.2.2203 <b>SF@</b> 2258 </code> 2259 </a> 2260 <BR> 2261 <B>s-f-fetch</B> FLOATING EXT 2262 <BR> 2263 <pre> 2264 ( sf-addr -- ) ( F: -- r ) 2265 or ( sf-addr -- r ) 2266 </pre> 2267 2268 <P> 2269 2270 Fetch the 32-bit IEEE single-precision number stored at sf-addr to the 2271 floating-point stack as r in the internal representation. If the IEEE 2272 single-precision significand has more precision than the internal 2273 representation, it will be rounded to the internal representation using 2274 the <B>round to nearest</B> rule. An ambiguous condition exists if the 2275 exponent of the IEEE single-precision representation is too large to be 2276 accommodated by the internal representation. 2277 <p> 2278 2279 <code> 2280 See: 2281 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses, 2282 <A href=dpans12.htm#12.3.2>12.3.2</a> Floating-point operations. 2283 </code> 2284 2285 <P> 2286 2287 <hr> 2288 <A name=12.6.2.2204> 2289 <code> 2290 12.6.2.2204 <b>SFALIGN</b> 2291 </code> 2292 </a> 2293 <BR> 2294 <B>s-f-align</B> FLOATING EXT 2295 <BR> 2296 <pre> 2297 ( -- ) 2298 </pre> 2299 2300 <P> 2301 2302 If the data-space pointer is not single-float aligned, reserve enough 2303 data space to make it so. 2304 <P> 2305 2306 <code> 2307 See: 2308 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 2309 </code> 2310 2311 <P> 2312 2313 <hr> 2314 <A name=12.6.2.2206> 2315 <code> 2316 12.6.2.2206 <b>SFALIGNED</b> 2317 </code> 2318 </a> 2319 <BR> 2320 <B>s-f-aligned</B> FLOATING EXT 2321 <BR> 2322 <pre> 2323 ( addr -- sf-addr ) 2324 </pre> 2325 2326 <P> 2327 2328 sf-addr is the first single-float-aligned address greater than or equal 2329 to addr. 2330 <P> 2331 2332 <code> 2333 See: 2334 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 2335 </code> 2336 2337 <P> 2338 2339 <hr> 2340 <A name=12.6.2.2207> 2341 <code> 2342 12.6.2.2207 <b>SFLOAT+</b> 2343 </code> 2344 </a> 2345 <BR> 2346 <B>s-float-plus</B> FLOATING EXT 2347 <BR> 2348 <pre> 2349 ( sf-addr1 -- sf-addr2 ) 2350 </pre> 2351 2352 <P> 2353 2354 Add the size in address units of a 32-bit IEEE single-precision number 2355 to sf-addr1, giving sf-addr2. 2356 <P> 2357 2358 <code> 2359 See: 2360 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 2361 </code> 2362 2363 <P> 2364 2365 <hr> 2366 <A name=12.6.2.2208> 2367 <code> 2368 12.6.2.2208 <b>SFLOATS</b> 2369 </code> 2370 </a> 2371 <BR> 2372 <B>s-floats</B> FLOATING EXT 2373 <BR> 2374 <pre> 2375 ( n1 -- n2 ) 2376 </pre> 2377 2378 <P> 2379 2380 n2 is the size in address units of n1 32-bit IEEE single-precision 2381 numbers. 2382 <P> 2383 2384 <code> 2385 See: 2386 <A href=dpans12.htm#12.3.1.1>12.3.1.1</a> Addresses 2387 </code> 2388 2389 2390 <hr> 2391 <A href=dpans.htm#toc><IMG src="up.gif" ></A> Table of Contents 2392 <BR> 2393 <A href=dpans13.htm><IMG src="right.gif" ></A> 2394 Next Section 2395 <P> 2396 </BODY> 2397 </HTML>