Date: Mon, 7 Sep 2026 21:11:53 +1000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Getting the exponent of an x87 float Newsgroups: comp.lang.forth References: <115qthh$3pnrg$1@dont-email.me> <116rnis$27njv$1@dont-email.me> <6a9170ca$1@news.ausics.net> <2026Aug28.161745@mips.complang.tuwien.ac.at> <116slt9$2k0en$1@dont-email.me> <116snc1$2k0en$2@dont-email.me> <116so74$2k0en$3@dont-email.me> <116ubjb$34u1v$1@dont-email.me> <2026Aug29.123526@mips.complang.tuwien.ac.at> <116ul9s$mj0h$1@dont-email.me> <116vd6n$3gogv$1@dont-email.me> <116vdq6$3gogv$2@dont-email.me> <116viqp$mvdi$1@dont-email.me> <6a98c5d1$1@news.ausics.net> <117bmre$3lgr0$1@dont-email.me> <6a996e70$1@news.ausics.net> <117bulh$3oe72$1@dont-email.me> <6a9a1f89$1@news.ausics.net> <117f3th$tbos$1@dont-email.me> <6a9b7cf3$1@news.ausics.net> <117h78t$1hpi9$2@dont-email.me> <6a9c4832$1@news.ausics.net> <117i84b$1tflm$1@dont-email.me> <6a9cd297$1@news.ausics.net> <6a9d2ae0$1@news.ausics.net> <117jn2q$2boon$2@dont-email.me> <6a9e0cc0$1@news.ausics.net> <117l6pe$2sjp8$1@dont-email.me> <117lmhg$2e74o$1@dont-email.me> Content-Language: en-GB From: dxf In-Reply-To: <117lmhg$2e74o$1@dont-email.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: news.ausics.net Message-ID: <6a9e9bfa@news.ausics.net> Organization: Ausics - https://newsgroups.ausics.net Lines: 29 X-Complaints: abuse@ausics.net Path: csiph.com!news.bbs.nz!news.ausics.net!not-for-mail Xref: csiph.com comp.lang.forth:135591 On 7/09/2026 4:45 pm, marcel hendrix wrote: > On 9/7/2026 4:16 AM, Krishna Myneni wrote: >> On 9/6/26 20:00, dxf wrote: > [..]>>    s" 9.999999999999999D" >dd ddfs. cr >>>    +9.9999999999999990000000000000003 dd 0 >>> While the correct values are now printed, the formatting is a bit off in >>> some cases.  It doesn't seem occur with mine (for whatever reason). > > While experimenting/fooling  around, I noticed something strange with my own implementation: > [...] > It looks like >DD leaves something small for the float having the LSBs, instead of 0e. This must be related to a problem with the FPU stack not > obeying 53bits! for some reason: Try replacing: ddprecision 0 ?DO peelDigit shiftBy10 LOOP peelDigit ddprecision 0 ?DO cnvrt LOOP FDEC @ HOLD cnvrt with: ddprecision 0 ?DO peelDigit shiftBy10 LOOP peelDigit ddprecision 0 ?DO DUP 0< IF 10 + SWAP 1- SWAP THEN cnvrt LOOP FDEC @ HOLD cnvrt I found 'peelDigit' could return weird values and these messed up the output. The above attempts to workaround those values.