> From: "Frank Klemm" <[EMAIL PROTECTED]>
>
> #include <stdio.h>
>
> float x1 = 1.e30;
> float x2 = 1.e31;
> float x3 = 1.e32;
>
> int main ( void )
> {
> float x4;
>
> x4 = x1*x2*x3 / (x1*x2 + x2*x3 + x3*x1);
>
> printf ( "%g\n", x4 );
> return 0;
> }
>
> The code line x4=... is equivalent to
>
> x4 = (float) ((double)x1*x2*x3 / ((double)x1*x2 + (double)x2*x3 +
(double)x3*x1));
No, that would be very bad for machines without hardware 'double' support.
K&R1 did require that behaviour, though. (The change is explicitly noted in
K&R2).
> Note, that the optimizer of gcc-2.95 isn't standard conform.
I don't doubt it. :)
> One exception for implicit type conversations are functions calls of
prototyped
> functions (Note: Not in K&R2, but in ANSI C3.159-1989 and later).
Exception from what?
> PS: Nice try for MS VC++:
>
> unsigned __int64 x = 123456789012345LL;
> double y;
>
> y = x;
Didn't they finally fix that in SP3?
-- Mat.
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )