home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4376 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  966 b 

  1. Path: sparky!uunet!gatech!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
  2. From: dic5340@hertz.njit.edu (David Charlap)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Whats wrong with floor()?
  5. Message-ID: <1992Aug21.200819.22295@njitgw.njit.edu>
  6. Date: 21 Aug 92 20:08:19 GMT
  7. References: <2118@lunic.luth.se>
  8. Sender: news@njit.edu
  9. Organization: New Jersey Institute of Technology, Newark, N.J.
  10. Lines: 18
  11. Nntp-Posting-Host: hertz.njit.edu
  12.  
  13. In article <2118@lunic.luth.se> ulf@goliat.dc.luth.se (Ulf Ruthberg) writes:
  14. >If I do the following:
  15. >
  16. >double tmp=33433.740234;
  17. >
  18. >printf("%f %f",tmp,floor(tmp));
  19. >
  20. >I expect the result "33433.740234 33433"
  21. >but what I get is "33433.740234 33433.740234
  22. >
  23. >A bug in GCC or in me?
  24.  
  25. Did you remember to #include <math.h>?
  26. -- 
  27.    |)  David Charlap           "I don't even represent myself
  28.   /|_  dic5340@hertz.njit.edu   sometimes so NJIT is right out!.
  29.  ((|,)
  30.   ~|~  Hi! I am a .signature virus, copy me into your .signature file.
  31.