home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 7994 < prev    next >
Encoding:
Text File  |  1992-08-12  |  2.1 KB  |  66 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!usc!sdd.hp.com!mips!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!informatik.tu-muenchen.de!menes
  3. From: menes@Informatik.TU-Muenchen.DE (Rainer Menes)
  4. Subject: floating point in Linux
  5. Keywords: pow()
  6. Originator: menes@suniams2.statistik.tu-muenchen.de
  7. Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
  8. Organization: Technische Universitaet Muenchen, Germany
  9. Date: Wed, 12 Aug 1992 14:01:06 GMT
  10. Message-ID: <1992Aug12.140106.3460@Informatik.TU-Muenchen.DE>
  11. Lines: 53
  12.  
  13.  
  14. Hey Linuxer's,
  15.  
  16. Yesterday I ported POV-Ray1.0 to Linux. The modifications are minimal to run the raytracer
  17. under Linux with X11.v1.1. But after play around I get some coredumps in sencefiles witch run
  18. with out problems on my Mac, PC, Sun Sparcstation and a Transputerworkstation. With gdb 4.5
  19. it was easy to find the "bug". The pow function is not IEEE compatible and produces floatingpoint
  20. exceptions when reaching MINDOUBLE. If the value gets smaller that MINDOUBLE you get nice long
  21. random numbers, but no exception. Now a little test program:
  22.  
  23. Compiler gcc V2.2.2
  24. Linux 0.97
  25.  
  26. -------------------------cut here----------------------------------------
  27. #include <stdio.h>
  28. #include <math.h>
  29.  
  30. main()
  31. {
  32.     double a = 0.094257769855355562;
  33.     double b = 300.0;
  34.     double test;
  35.  
  36.     test = pow(a,b);
  37.     printf("%1.19le\n",test);
  38. }
  39. ________________________end of test.c-------------------------------------
  40.  
  41. This program runs with out problems on the machines I mentioned before with the correct
  42. result (1.973095167e-308). If you set the variable b to 480.0 than all machines give you the
  43. result (0.0) and no excetion, but not linux. With linux you get a nice random value nearly to
  44. screenlines long.
  45.  
  46. Now my question, is someone aware of this bug? (I think there are some more bugs in mathlib)
  47. Are there any work arounds?
  48.  
  49. I would be happy to hear from you,
  50.  
  51. Rainer
  52.  
  53. please send mail to menes@statistik.tu-muenchen.de
  54.  
  55. Rainer Menes
  56. Inst. fuer Angewandte Mathematik der TU-Muenchen
  57. Arcisstrasse 23
  58. 8000 Muenchen 2
  59. Germany
  60.  
  61. P.S: I report something simular one month ago in this newsgroup, but no replay.
  62. Does nobody care about numerics?????
  63.  
  64.  
  65.  
  66.