Sujet : Re: FP number syntax
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 31. Dec 2024, 22:57:55
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Dec31.225755@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5
User-Agent : xrn 10.11
albert@spenarnc.xs4all.nl writes:
A forth that interprets e.g. 3.14 as a floating point number
is as non-standard as a Forth that interprets 3.14 is a double.
Forth-94 and Forth-2012 do not standardize recognizing 3.14, so
standard systems are allowed to deal with "3.14" as they deem useful.
The possible options include recognizing "3.14" as a double-cell
integer, as a FP number, or not recognizing "3.14" and producing an
error message.
However, I think that recognizing "314." as a double-cell integer (as
required by these standards), but recognizing "3.14" as an FP number
is even more confusing and error prone than recognizing both as a
double-cell integer.
How would a proposal like this fare:
"
A double number is only recognized as it ends *and starts*
with a period.
Existing practice? What's wrong with "#314."?
Recognizing a double if it ends only in a period becomes
obsolescent.
"
That part may have an easier time.
- 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