home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 117,177 of 117,927   
   dxf to Hans Bezemer   
   Re: "The Best Programming Language for t   
   09 Apr 25 01:15:59   
   
   From: dxforth@gmail.com   
      
   On 8/04/2025 9:43 pm, Hans Bezemer wrote:   
   > On 07-04-2025 13:05, dxf wrote:   
   > As a matter of fact, the whole issue can be solved by one single very simple   
   addition to the standard. All my FP systems hold this very definition for   
   SET-PRECISION:   
   >   
   > \ 34: Reimplemented PRECISION and SET-PRECISION.   
   > maxdigits VALUE PRECISION   
   > : SET-PRECISION ( n -- )         maxdigits MIN TO PRECISION ;   
   >   
   > Since the FLOAT wordset is always in decimal (12.4.1.2 Ambiguous conditions   
   - BASE is not decimal (12.6.1.2143 REPRESENT, 12.6.2.1427 F., 12.6.2.1513 FE.,   
   12.6.2.1613 FS.) it is trivial to calculate the number of significant digits.   
   >   
   > The definition given here ( --- CONSTANT MAXDIGITS) ensures that the value   
   issued to SET-PRECISION is always sane.   
   >   
   > Of course, if one does not have access to some carnal knowledge concerning   
   the mantissa, one does have a problem concerning porting and maintenance.   
      
   It's not SET-PRECISION (presumably the implementer has made that sane)   
   but rather variability when values are sane e.g.   
      
   >> 6 set-precision  ok   
   >> 1e-4 f.  0.000100000  ok   
   >>   
   >> 6 set-precision  ok   
   >> 1e-4 f. 0.0001  ok   
      
   While both of those are numerically correct, they're plainly different i.e.   
   11 characters vs. 6 characters.  As an app writer I'd like some uniformity   
   here as I might want to output several columns of numbers on a screen.  To   
   do that I need to know how wide to make those columns.   
      
   I can't believe other langs have this issue as it would be hard to write   
   portable apps?   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca