Article View: comp.lang.forth
Article #51Re: F.N floating point format word
From: Krishna Myneni
Date: Fri, 09 Oct 2026 21:54
Date: Fri, 09 Oct 2026 21:54
81 lines
4145 bytes
4145 bytes
On 10/9/26 4:54 AM, dxf wrote: ... > TL;DR AFAICS if one wants accurate rounding to 17 digits (or 700 digits) > from F.N then that's the value of u that needs to be passed when asking > for the exponent. Because of the round trip requirement for IEEE binary64 you should not need to ask for more than 17 digits to the initial call to REPRESENT in order to get the exponent. In my F.N code from Peter, I have the value u set at 17. Of course when you actually get down to using REPRESENT to obtain the number of digits you want, u must be set accordingly. Consider the following example: pad 8 erase 1 pad ! pad df@ fs. 4.94065645841247e-324 ok pad df@ 324 f.n 0.000 ... 005 \ last digit is 324 digits to right of decimal point pad df@ 328 f.n 0.000 ... 004 940 7 pad df@ 424 f.n 0.000 ... 004 940 656 458 412 465 441 765 687 928 682 213 723 650 598 026 143 247 644 255 856 825 006 755 072 702 087 518 652 998 363 616 359 923 8 ok It is rounding correctly. For reference see the output below. Do you have an example which shows that u > 17 is needed for the initial call to REPRESENT? -- Krishna 800 set-precision ok pad f@ fs. Digits 1 4. 2--031 940 656 458 412 465 441 765 687 928 682 32--061 213 723 650 598 026 143 247 644 255 856 62--091 825 006 755 072 702 087 518 652 998 363 92--121 616 359 923 797 965 646 954 457 177 309 122--151 266 567 103 559 397 963 987 747 960 107 152--181 818 781 263 007 131 903 114 045 278 458 182--211 171 678 489 821 036 887 186 360 569 987 212--241 307 230 500 063 874 091 535 649 843 873 242--271 124 733 972 731 696 151 400 317 153 853 272--301 980 741 262 385 655 911 710 266 585 566 302--331 867 681 870 395 603 106 249 319 452 715 332--361 914 924 553 293 054 565 444 011 274 801 362--391 297 099 995 419 319 894 090 804 165 633 392--421 245 247 571 478 690 147 267 801 593 552 422--451 386 115 501 348 035 264 934 720 193 790 452--481 268 107 107 491 703 332 226 844 753 335 482--511 720 832 431 936 092 382 893 458 368 060 512--541 106 011 506 169 809 753 078 342 277 318 542--571 329 247 904 982 524 730 776 375 927 247 572--601 874 656 084 778 203 734 469 699 533 647 602--631 017 972 677 717 585 125 660 551 199 131 632--661 504 891 101 451 037 862 738 167 250 955 662--691 837 389 733 598 993 664 809 941 164 205 692--721 702 637 090 279 242 767 544 565 229 087 722--751 538 682 506 419 718 265 533 447 265 625 752--781 000 000 000 000 000 000 000 000 000 000 782--800 000 000 000 000 000 000 0 e-324 ok
Technical Details
Message-ID:
<11abnq4$16oh0$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119oin2$26n99$1@dont-email.me> <11a01mr$sqrm$1@dont-email.me> <20261005150222.00006cf5@tin.it> <11a16nc$1camn$1@dont-email.me> <20261006080347.00002cdf@tin.it> <11a4tj5$2ku7v$1@dont-email.me> <20261007223526.000065ab@tin.it> <6ac7013a$1@news.ausics.net> <20261008121302.00007412@tin.it> <6ac8b9f0$1@news.ausics.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Krishna Myneni <krishna.myneni@ccreweb.org> Newsgroups: comp.lang.forth Subject: Re: F.N floating point format word Date: Fri, 9 Oct 2026 16:54:11 -0500 Organization: A noiseless patient Spider Lines: 81 Message-ID: <11abnq4$16oh0$1@dont-email.me> References: <119oin2$26n99$1@dont-email.me> <11a01mr$sqrm$1@dont-email.me> <20261005150222.00006cf5@tin.it> <11a16nc$1camn$1@dont-email.me> <20261006080347.00002cdf@tin.it> <11a4tj5$2ku7v$1@dont-email.me> <20261007223526.000065ab@tin.it> <6ac7013a$1@news.ausics.net> <20261008121302.00007412@tin.it> <6ac8b9f0$1@news.ausics.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 09 Oct 2026 21:54:13 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1270304"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eiV5GbS+SyXi9BbY0kwXW"; posting-host="f158375d86a66cd64e6404390dfa3c2c" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:0LE3V7FJcfxNvc95mEcoyJVio0E= sha256:RDv/0b1n8FMz/wcff72fg1JuN/6I29X7uNu8zAd/4UU= sha1:9+lQDFxr9Du2RIGYQAOvw2hb04A= sha256:4BkSs8Mx7GRSsgtz/RaNE+rzQUDPrOZ8VKTyRsqXe9A= In-Reply-To: <6ac8b9f0$1@news.ausics.net> Content-Language: en-US