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,951 messages   

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

   Message 116,979 of 117,951   
   dxf to Anton Ertl   
   Re: FP number syntax   
   01 Jan 25 11:45:27   
   
   From: dxforth@gmail.com   
      
   On 1/01/2025 8:51 am, Anton Ertl wrote:   
   > Paul Rubin  writes:   
   >> anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:   
   >>>    
   >>   
   >> Aha, thanks.  Similarly 8.3.2 for DPANS94.  Oddly, in gforth, "123.45"   
   >> pushes 12345 0.  I can understand "123." is a number (123) followed by a   
   >> decimal point, but I'd expect the 45 to either be invalid or another   
   >> number, giving 123 0 45.   
   >   
   > Traditionally, Forth has used the syntax 123.45 for fixed-point   
   > numbers.  You get the same number on the stack as with the standard   
   > "12345.", and in addition, the (user) variable DPL is set to indicate   
   > the position of the decimal point.  I have no idea how this crude way   
   > was used in practice, but in any case, Gforth implements this feature.   
      
   It's possible this came from Kitt Peak Forth (on which Forth-77 was based)   
   and picked up by Fig-forth.  'Starting Forth' (Forth Inc) supported   
   'embedded punctuation' - a range of characters including / # etc to simulate   
   various formatting e.g. time and date.   
      
   >   
   > The Forth-94 standardizers were apparently less convinced, so they   
   > standardized neither numbers with an embedded decimal point, nor DPL.   
      
   To support DPL I have >NUMBER increment it for every digit successfully   
   converted.  While most systems today have DPL (?) usage is probably too   
   diverse to standardize.   
      
   --- 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