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 116,995 of 117,927   
   albert@spenarnc.xs4all.nl to Anton Ertl   
   Re: FP number syntax   
   03 Jan 25 15:37:14   
   
   In article <2025Jan2.165111@mips.complang.tuwien.ac.at>,   
   Anton Ertl  wrote:   
   >albert@spenarnc.xs4all.nl writes:   
   >>The confusion between 31E0 (hex) 31E0 (fp) 3.10 is another   
   >>roadblock to Forth newbies.   
   >   
   >Certainly, especially the latter.  The hex problem can be eliminated   
   >by always keeping the BASE as DECIMAL, and writing hex numbers as   
   >$31E0.  The 3.10 tradition and the 31. standard can be addressed with   
   >a variation of your statement:   
   >   
   >   Recognizing a double if it contains no number prefix and one single   
   >   period at the end is obsolescent.   
   >   
   >One step later a standard Forth system could recognize 3.10 as well as   
   >31. and 31e as FP values, #31. as a double-cell integer, and $31e   
   >as a single-cell integer.   
      
   One step further is to use 0x for hex values, and free $ for   
   environment strings.   
   This scheme has so much going for it that I tend to give up   
   the advantage to represent floating points exactly in hex. 1]   
   Then probably one can forget BASE DECIMAL and ban double numbers to   
   an obscure region of a library.   
      
   1] This is not easy. I have been in many projects where floating points   
   were transferred in text, loosing precision. But of course parameters   
   in oil drill samples need not 5 decimal places.   
      
   >   
   >- anton   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- 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