On 19/11/17 10:15, Adriaan van Os wrote:
Mark Morgan Lloyd wrote:
That obviously applies to all languages, I've never come across > something which can represent 1/3 or pi exactly.
If you do read what is written in the link - that is not the issue. The issue is how to interpret floating-point constants and how to convert single-precision floating-point to decimal. In BCD, that conversion is exact.

I read the link before posting. You aren't going to represent 1/3 or Pi exactly in BCD either.

But FORTRAN- or rather > the way that people use it- has always seemed peculiarly sensitive, the > classic problem being that recompiling with the optimising variant of > the compiler produces significantly different results.
This is nonsense too. The issue is whether to use IEEE-754 math or not. And there are (or should be) compiler switches for that purpose. Not just in Fortran.

Oh really? Well I'll let you travel back in time and argue with numerous former colleagues who've routinely found differences between their "fortran" (-IV, -77 or whatever) and "fast fortran" compilers which in those days tended to be separate programs even if supplied together.

I stick to my position: a "tidy" language (I'm not going to fall into the trap of using a word like "regular" here) generally results in a tidy compiler design, and that should go a long way towards avoiding implementation errors.

I think we're in broad agreement though: don't try converting backend code unless you know exactly what you're doing, and Pascal (including Lazarus/LCL etc.) can be valuable when implementing a C21st frontend :-)

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to