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

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!gatech!bloom-beacon!eru.mt.luth.se!lunic!goliat.dc.luth.se!ulf
  2. From: ulf@goliat.dc.luth.se (Ulf Ruthberg)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Whats wrong with floor()?
  5. Message-ID: <2125@lunic.luth.se>
  6. Date: 23 Aug 92 13:53:52 GMT
  7. References: <1992Aug21.200819.22295@njitgw.njit.edu>
  8. Sender: news@luth.se
  9. Lines: 30
  10. Nntp-Posting-Host: goliat.dc.luth.se
  11. X-Newsreader: Tin 1.1 PL3
  12.  
  13. dic5340@hertz.njit.edu (David Charlap) writes:
  14. : In article <2118@lunic.luth.se> ulf@goliat.dc.luth.se (Ulf Ruthberg) writes:
  15. : >If I do the following:
  16. : >
  17. : >double tmp=33433.740234;
  18. : >
  19. : >printf("%f %f",tmp,floor(tmp));
  20. : >
  21. : >I expect the result "33433.740234 33433"
  22. : >but what I get is "33433.740234 33433.740234
  23. : >
  24. : >A bug in GCC or in me?
  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.  
  32.  
  33. Yes, math.h is included.
  34. Exactly the same code (Quite a bit more than the above) compiles and give
  35. the expected result when compiled in DOS, Borland C 2.0, and run.
  36. I have tried some other floating manipulations with the same result.
  37.  
  38.    ===================  Boring signature follows  ==========================
  39.        Ulf Ruthberg, ulf@dc.luth.se, {uunet,mcsun}!sunic!dc.luth.se!ulf
  40.                Computer Service Center, Lule} University.
  41.    ====I'd rather have a bottle in front of me, than a frontal lobotomy.====
  42.