Marco van de Voort wrote:
Marco van de Voort wrote:
Something encountered while testing FPC. What is your opinion on this, should this compile?
Const inf=1/0; NaN=0/0; minusinf=-1/0;
I don't think so. Both BP (your paragon) and GPC don't. The standard, if you care, does not seem to explicitly mention this case, but since it refers to the usual mathematical rules, I understand that it doesn't allow it, either.
We also have a Delphi mode, which is getting increasingly important This is valid Delphi code unfortunately. I also thought it is ugly, specially from a mathematical viewpoint. I said that on the Delphi list, and it turns out to be specified in the IEEE standard (at least according to them)
No mention in ISO10206. They may be referring to the IEEE FP standard, which is not binding on the language, but convenient.
It would do no harm to have them as predefined constants at level 0 - this never interferes with user definitions. Of course, what _is_ that constant? If the real processor is IEEE then there is a hex pattern for them. Comparisons against them must follow special rules.