[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fmin and fmax odd behaviour
From: |
Bryn Jeffries |
Subject: |
fmin and fmax odd behaviour |
Date: |
Tue, 06 Jan 2004 17:03:28 +1100 |
Hi,
I've had trouble using fmax and fmin. I cannot check the bugs database
to check whether bugs have already been recorded for them as the server
appeared to be down at the time of writing.
Here is an example (fmaxtest.c):
#include <stdio.h>
#include <math.h>
int main(void)
{
double a=0.4;
double b=7.2;
printf("\nMax is %g, min is %g\n", fmax(a,b), fmin(a,b));
return 0;
}
I am expecting to be told that Max is 7.2, min is 0.4. Instead:
% gcc fmaxtest.c -lm
% ./a.out
Max is -9.25597e+61, min is 6.64587e-316
Clearly this is not what was expected. For what it's worth, I'm running
a Fedora Core 1 system on an AMD Athlon machine. I have obtained similar
results for a Mandrake 9.2 system on another AMD Athlon system.
% gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux
Thread model: posix
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
% rpm -q glibc
glibc-2.3.2-101.1
% rpm -q glibc-headers
glibc-headers-2.3.2-101.1
Please let me know whether this is a known bug.
Many thanks,
Bryn
--
Bryn Jeffries
Visiting Fellow
Department of Physics
Division of Information and Communication Sciences
Macquarie University
Sydney
NSW 2109
Australia
Office: 315 E7A -=- Lab: 261 E7B
Tel: +61-2-9850-7583
Fax: +61-2-9850-8115
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- fmin and fmax odd behaviour,
Bryn Jeffries <=