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)
If you want access to these special values, you might rather want to supply them as predefined constants (like MinReal, MaxReal and EpsReal) -- though there may arise problems on non-IEEE FP systems (if you support any) which may not even know those values ...
I don't know how many types exist under IEEE. Afaik there are larger types? (doesn't the Itanium have 128 bit FP types?)