[M3devel] Integer literals
Jay K
jay.krell at cornell.edu
Tue Jan 12 07:21:43 CET 2010
And even these 80 bit and 128 bit formats I'm sure can represent all values losslessly of the smaller types. I have to look into this stuff though.
- Jay
From: jay.krell at cornell.edu
To: mika at async.async.caltech.edu
CC: m3devel at elegosoft.com
Subject: RE: [M3devel] Integer literals
Date: Tue, 12 Jan 2010 06:19:45 +0000
When do you forsee any non-IEEE 754 floating point environments coming into existance?
Or for that matter, simple efficient compatibility with all the C, C++, Java, Modula-3, JavaScript, etc. code in the world not being a feature of all CPUs, at least ones that have any floating point support? Or any software floating point library?
For that matter, probably Perl and Python, but I'd have to check.
Chances are high they only expose 64bit float and nothing else.
The precisions and magnitudes of 32bit float and 64bit double are *really old* and in no apparent danger of going away. I think over 25 years and counting (consider the "SANE" environment of the Macintosh in 1984 and the similarly timed Apple 6502 package. I think Applesoft/Microsoft BASIC might have used a different format, but the processor had no floating point support.) I think the only system with different formats is VAX. And Alpha supports IEEE-754 and VAX. ?
I know, I know "never say never", but sometimes....?
Certainly there are also 80bit formats on x86 and 68K.
Though x86 is moving away from this with SSE/SSE2.
And I think 128bit formats on PowerPC.
And something beyond 64bits on IA64 (Itanium).
- Jay
> To: jay.krell at cornell.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] Integer literals
> Date: Mon, 11 Jan 2010 21:46:03 -0800
> From: mika at async.async.caltech.edu
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100112/656c93c9/attachment-0002.html>
More information about the M3devel
mailing list