Sujet : Re: FP number syntax
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 02. Jan 2025, 16:51:11
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jan2.165111@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5
User-Agent : xrn 10.11
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.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.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