bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug-glibc Digest, Vol 14, Issue 5


From: RolloS
Subject: Re: Bug-glibc Digest, Vol 14, Issue 5
Date: Tue, 6 Jan 2004 08:22:53 -0700

Hi Bryn,

I tried your little test program:
          double a=0.4;
          double b=7.2;
          printf("\nMax is %g, min is %g\n", fmax(a,b), fmin(a,b));

using Project Builder under Mac OS X (10.2.8, jaguar) and got the expected result:
Max is 7.2, min is 0.4

On Tuesday, Jan 6, 2004, at 02:49 America/Denver, address@hidden wrote:
[snip]
------------------------------
Message: 8
Date: Tue, 06 Jan 2004 17:03:28 +1100
From: Bryn Jeffries <address@hidden>
Subject:

 and fmax odd behaviour
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain


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
----------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]