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

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!cmcl2!panix!os2man
  2. From: os2man@panix.com (Larry Salomon Jr.)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Whats wrong with floor()?
  5. Message-ID: <1992Aug16.164006.2345@panix.com>
  6. Date: 16 Aug 92 16:40:06 GMT
  7. References: <2118@lunic.luth.se>
  8. Organization: PANIX Public Access Unix, NYC
  9. Lines: 22
  10.  
  11. In <2118@lunic.luth.se> ulf@goliat.dc.luth.se (Ulf Ruthberg) writes:
  12.  
  13. >If I do the following:
  14.  
  15. >double tmp=33433.740234;
  16.  
  17. >printf("%f %f",tmp,floor(tmp));
  18.  
  19. >I expect the result "33433.740234 33433"
  20. >but what I get is "33433.740234 33433.740234
  21.  
  22. >A bug in GCC or in me?
  23.  
  24. This shouldn't have anything to do with it, but %f is for float types.  You
  25. should be using %lf.
  26.  
  27. Cheers,
  28. Q
  29. -- 
  30. "If you choose not to decide, you  | "A fool and his money are fun to go
  31.  still have made a choice" - Rush  |  out with" - seen on a T-shirt
  32. ------------------------------------------------------------------------
  33.