home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!rutgers!cmcl2!panix!os2man
- From: os2man@panix.com (Larry Salomon Jr.)
- Newsgroups: comp.os.os2.programmer
- Subject: Re: Whats wrong with floor()?
- Message-ID: <1992Aug16.164006.2345@panix.com>
- Date: 16 Aug 92 16:40:06 GMT
- References: <2118@lunic.luth.se>
- Organization: PANIX Public Access Unix, NYC
- Lines: 22
-
- In <2118@lunic.luth.se> ulf@goliat.dc.luth.se (Ulf Ruthberg) writes:
-
- >If I do the following:
-
- >double tmp=33433.740234;
-
- >printf("%f %f",tmp,floor(tmp));
-
- >I expect the result "33433.740234 33433"
- >but what I get is "33433.740234 33433.740234
-
- >A bug in GCC or in me?
-
- This shouldn't have anything to do with it, but %f is for float types. You
- should be using %lf.
-
- Cheers,
- Q
- --
- "If you choose not to decide, you | "A fool and his money are fun to go
- still have made a choice" - Rush | out with" - seen on a T-shirt
- ------------------------------------------------------------------------
-