From: Richard Polton <richard.polton@msdw.com>
To: axp-list <axp-list@redhat.com>
Subject: strange (incorrect) arithmetic behaviour
Date: Tue, 31 Oct 2000 10:17:07 +0000 [thread overview]
Message-ID: <39FE9C23.7A6CEF2A@msdw.com> (raw)
Hi,
I have stock RH6.1 on my LX164 machine. When executing the following
code I see SIGFPE.
#include <stdio.h>
#include <math.h>
main()
{
float a = -3.4e38;
float b = 1.0;
float c = a*b;
printf( "%f\n%f\n%f\n", a, b, c);
}
In gdb I can see that c contains 2.4e-314 which is not the
expected result ;). To compile I use egcs-2.91.66 as supplied with
RH6.1 with no additional command line options.
What am I missing or doing incorrectly?
Thanks,
Richard
next reply other threads:[~2000-10-31 10:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-31 10:17 Richard Polton [this message]
2000-10-31 12:45 ` strange (incorrect) arithmetic behaviour Uncle George
2000-10-31 13:42 ` Richard Polton
2000-10-31 14:37 ` Stefan Schroepfer
2000-10-31 15:38 ` Michal Jaegermann
-- strict thread matches above, loose matches on Subject: below --
2000-10-31 22:36 Phil Carmody
2000-11-02 13:35 ` Stefan Schroepfer
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox