|
From: Michael D. S. <for...@hi...> - 2003-09-28 18:57:47
|
I know one thing, It can be done. I did it, late last night as an error. It was driving me nuts until I found it. Unfortunately, it was late, and I cannot duplicate the results now. I think it had something to do with some parentheses being -- not quite right :) But I'm not sure. It's just the one liner that's a trick. Certainly a little longer version will work easily. int wholenumber; double number; double decimal; wholenumber = int number; decimal = number - wholenumber; That's untested, and I'm still occasionally mixing in some PERL, so... caveat emptor. ms At 08:55 AM 9/28/03, you wrote: >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Hi List! > >I have a problem with getting the floatpart from a float. My code to >do this >looks so atm: > >double number; >number = number - (int)number; > >but with this usage I always get 0 for number. Does someone >know how to >get the floatpart and can tell me? > >so long > >Tim > >- -- >WE ARE TEH BORG! > RESSISTANCE IS FUTILE! > http://we-are-teh-b.org/~tim/borg.key >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.0.6 (MingW32) - WinPT 0.5.6 > >iD8DBQE/dugtsMXChvH2qP0RArldAKCyN/oDTMOkppsAneVfnc2laQaRSACgmfHN >yEoHOoLKPP+n/OzQ6Dsy05A= >=aDJe >-----END PGP SIGNATURE----- > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |