From: dxforth@gmail.com   
      
   On 1/01/2025 10:47 pm, Anton Ertl wrote:   
   > 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   
      
   My bad. >NUMBER increments DPL but how/when appears to vary with   
   implementation.   
   Also Kitt Peak Forth (1979) DPL is for output - not input!   
      
   > 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?   
      
   Since >NUMBER (and previous incarnations) all increment DPL such use must   
   have been originally envisioned.   
      
   > 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.   
      
   Pulling DPL out of systems that currently use it might result in complaints.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|