home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!usc!sdd.hp.com!mips!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!informatik.tu-muenchen.de!menes
- From: menes@Informatik.TU-Muenchen.DE (Rainer Menes)
- Subject: floating point in Linux
- Keywords: pow()
- Originator: menes@suniams2.statistik.tu-muenchen.de
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Wed, 12 Aug 1992 14:01:06 GMT
- Message-ID: <1992Aug12.140106.3460@Informatik.TU-Muenchen.DE>
- Lines: 53
-
-
- Hey Linuxer's,
-
- Yesterday I ported POV-Ray1.0 to Linux. The modifications are minimal to run the raytracer
- under Linux with X11.v1.1. But after play around I get some coredumps in sencefiles witch run
- with out problems on my Mac, PC, Sun Sparcstation and a Transputerworkstation. With gdb 4.5
- it was easy to find the "bug". The pow function is not IEEE compatible and produces floatingpoint
- exceptions when reaching MINDOUBLE. If the value gets smaller that MINDOUBLE you get nice long
- random numbers, but no exception. Now a little test program:
-
- Compiler gcc V2.2.2
- Linux 0.97
-
- -------------------------cut here----------------------------------------
- #include <stdio.h>
- #include <math.h>
-
- main()
- {
- double a = 0.094257769855355562;
- double b = 300.0;
- double test;
-
- test = pow(a,b);
- printf("%1.19le\n",test);
- }
- ________________________end of test.c-------------------------------------
-
- This program runs with out problems on the machines I mentioned before with the correct
- result (1.973095167e-308). If you set the variable b to 480.0 than all machines give you the
- result (0.0) and no excetion, but not linux. With linux you get a nice random value nearly to
- screenlines long.
-
- Now my question, is someone aware of this bug? (I think there are some more bugs in mathlib)
- Are there any work arounds?
-
- I would be happy to hear from you,
-
- Rainer
-
- please send mail to menes@statistik.tu-muenchen.de
-
- Rainer Menes
- Inst. fuer Angewandte Mathematik der TU-Muenchen
- Arcisstrasse 23
- 8000 Muenchen 2
- Germany
-
- P.S: I report something simular one month ago in this newsgroup, but no replay.
- Does nobody care about numerics?????
-
-
-
-