[M3devel] Integer literals

Mika Nystrom mika at async.async.caltech.edu
Tue Jan 12 06:46:03 CET 2010


Jay K writes:
>
>>> One thing I've really struggled with over the introduction of LONGINT is
>>> the need for distinct literal forms. This strikes me as odd=2C since
>>> literals are really just ways of writing values=2C rather than stating
>>> anything about how they should be represented.
>>> (Yes=2C I know that the REAL/LONGREAL/EXTENDED literals are all distinct=
>=2C
>>> but they really do have incompatible value representations).
>>
>> I agree=2C the need for distinctly typed literals is much greater for the
>> floating types than the integer types=2C because they can't be viewed
>> as having overlapping value sets in any reasonable way.
>
>=20
>Huh? This seems to me to be directly opposite of the truth.
>LONGREAL is a strict superset of REAL in what it can represent.
>There is *complete* overlap.
>Am I really mistaken here?
>Floating point is indeed very wierd=2C but it isn't this wierd.
>Right?
>=20
>=20
> - Jay

Jay, I think if you have hardware that's strictly compliant with IEEE
754, you're right.  Or at least there exists an interpretation of the
values that have this property.  I alluded earlier to the fact that
Alpha represents single-precision by zeroing out the middle of the
double-precision register (some of the mantissa and some of the exponent).

However I'm sure there are systems for which this is not true.  Is 
Modula-3 forbidden from being ported to such machines?

    Mika



More information about the M3devel mailing list