Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.lang.forth Subject: Re: FP number syntax Date: Wed, 01 Jan 2025 11:47:16 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 35 Message-ID: <2025Jan1.124716@mips.complang.tuwien.ac.at> References: <0d58f9f2c2e7ce33f032cbda245a1eee4782552f@i2pn2.org> <874j2rpcl3.fsf@nightsong.com> <372725cbde75de8c5e4f86e726b42d159b3bba93@i2pn2.org> <87zfkinuvb.fsf@nightsong.com> <2024Dec26.225518@mips.complang.tuwien.ac.at> <87v7v6neim.fsf@nightsong.com> <2024Dec31.225135@mips.complang.tuwien.ac.at> Injection-Date: Wed, 01 Jan 2025 12:59:10 +0100 (CET) Injection-Info: dont-email.me; posting-host="c697914aeadaf8e038f4781ec434a528"; logging-data="2903121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/A1uTo9Oi2o5bM7hL4YYN" Cancel-Lock: sha1:DqcjBqPHdhZWwjZJMeLDISz4wmQ= X-newsreader: xrn 10.11 Bytes: 2875 dxf writes: >On 1/01/2025 2:42 pm, Bernd Linsel wrote: >> It's usually implemented that DPL is reset to -1 when entering >NUMBER, >> each successful digit conversion increments it only if it is >= 0, and the first decimal separator encountered changes it from -1 to 0. > >Yes, in Fig-Forth. In Swiftforth DPL is just a flag. SwiftForth x64-Linux 4.0.0-RC89 15-Jul-2024 1 dpl ? -1023 ok 1.234 dpl ? 3 ok 12 dpl ? -1022 ok Apparently SwiftForth counts every digit starting with -1024, and "." setting the count to 0. So for doubles the behaviour is the same as that of Gforth, and testing for dpl @ 0< identifies singles on both systems. lxf and VFX behave like Gforth. So systems that implement DPL implement it similarly enough that programs can determine the number of digits after the decimal point. But does anybody actually make use of DPL? I have not seen a single use, ever. Is it just some feature that someone thought up and implemented, and we all continued to implement it because we could and it was traditional? If there has been a use at some time, is there still? I have not seen complaints about the non-standardization of DPL and the only-terminating decimal point in Forth-94 or Forth-2012. - anton -- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/ EuroForth 2024: https://euro.theforth.net