home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2342 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.2 KB  |  50 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
  3. From: mrs@cygnus.com (Mike Stump)
  4. Subject: Re:  floating point accuracy???
  5. Message-ID: <9209150813.AA01007@cygnus.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 15 Sep 1992 08:13:23 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 37
  12.  
  13. This is a problem with the backend I believe.  If it is not, then the
  14. problem in the front-end has been fixed.
  15.  
  16. On a sun4 I now get:
  17.  
  18. pow (4,6)= 4096.000000
  19. pow (4,6)= 4096
  20.  
  21. > Message-Id: <m0mUHwh-000AWzC@sophists.com>
  22. > Date: Mon, 14 Sep 92 11:02 EDT
  23. > From: lewis@sophists.com (Lewis G. Pringle)
  24. > To: bug-gcc@prep.ai.mit.edu
  25. > Reply-To: lewis@sophists.com
  26.  
  27. > /*
  28. >  * I'm not sure if this is a bug, a feature, or a configuration
  29. >  * problem, but the results of these math calls were a bit
  30. >  * surprising to me.
  31. >  *
  32. >  * This code we compiled with:
  33. >  *    gcc -o fred x.cc -lm
  34. >  * on a 68k box running a sysVr2.2 variant using gcc 2.2.1.
  35. >  *
  36. >  * The output was:
  37. >  *    pow (4,6)= 4096.000000
  38. >  *    pow (4,6)= 4095
  39. >  */
  40.  
  41. > #include <math.h>
  42. > #include <stdio.h>
  43.  
  44. > main ()
  45. > {
  46. >  printf ("pow (4,6)= %f\n", pow (4,6));
  47. >  printf ("pow (4,6)= %d\n", ((unsigned) pow (4,6)));
  48. > }
  49.  
  50.