* Re: Doubles broken
@ 1998-01-07 10:04 Stefan Schroepfer
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Schroepfer @ 1998-01-07 10:04 UTC (permalink / raw)
Quezcal wrote:
>
> If I use doubles for floating point calculations i get a lot of
> floating point exceptions, e.g. with this:
>
> main()
> {
> double a,b,c;
>
> a = -1;
> b = 1e-310;
> c=a*b;
> printf("%lf\n",c);
> }
>
> [...]
In addition to your second mail concerning '-mieee':
The 'l' modifier is not apllicable to the 'f' format specification
in printf, according to the printf man page 'f' is already suitable
for double.
Here is what gcc says with '-Wall':
warning: use of `l' length character with `f' type character
Stefan Schroepfer
scr@iis.fhg.de
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread* Doubles broken
@ 1998-01-06 20:28 Quezcal
0 siblings, 0 replies; 3+ messages in thread
From: Quezcal @ 1998-01-06 20:28 UTC (permalink / raw)
I am running an PC164LX 533Mhz Samsung Cpu Redhat 5.0
If I use doubles for floating point calculations i get a lot of
floating point exceptions, e.g. with this:
main()
{
double a,b,c;
a = -1;
b = 1e-310;
c=a*b;
printf("%lf\n",c);
}
Anything that uses a double from about e-308 to e-323 gives a
float.exception. Smaller and larger exponents just give -0 as would be
right. Any help? This is rather annoying for ray tracing.
If I use float instead it works. Could anybody veryfy this please?
I tried gcc and egcs-1.0, same effect. Help :)!
Email in reply would be most helpfull, thanks,
Olaf
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-01-07 10:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <199801062028.VAA28940@xyllomer.uni-paderborn.de>
1998-01-06 22:10 ` Doubles broken Quezcal
1998-01-07 10:04 Stefan Schroepfer
-- strict thread matches above, loose matches on Subject: below --
1998-01-06 20:28 Quezcal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox