[M3devel] INTEGER (and floating point)

Rodney M. Bates rodney_bates at lcwb.coop
Tue Apr 20 04:46:16 CEST 2010



Mika Nystrom wrote:
> 
> Modula-3 already uses floating point for this, which has the advantage
> you don't need to worry what the base is.  

The designers of Algol 60 gave us several good new ideas, but one place
they did a huge disservice was in renaming what had been called "floating
point" as "real".  This was and still is a lie.

One ugly property that floating point has is that the smallest interval
between representable values keeps getting larger as the value gets
larger.  Moreover, for representations of equal bit counts, floating
will always eventually get to the point that it no longer can even represent
the integers.  The interval eventually becomes two, then four, eight,
etc. (if the exponent is a power of two, as it usually is).

There are places where you care about large value range *and* precision
down to the integers, and file sizes are likely to be one of them.
National budgets might be too.  Ditto times.  Sometimes you can stand
the erosion of precision in large values, but not always.

Of course, if you compare a 32-bit integer to a 64-bit float, this
won't happen.  But I think the 64-bit float should be compared to
a 64-bit integer.

>     Mika
> 



More information about the M3devel mailing list