Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2005 Aug : Round(32.5) = 32

www.cryer.info
Managed Newsgroup Archive

Round(32.5) = 32

Subject:Round(32.5) = 32
Posted by:"Gordon Niessen" (gord..@gniessen.com)
Date:19 Aug 2005 07:46:07

When I call Round() I get inconsistent results.  Round(31.5) = 32,
Round(33.5) = 34, but Round(32.5) = 32 rather then 33.  Given that I
know in my app that the numbers will never have more then 2 decimals, I
plan to work around this by adding 0.00001 to catch any floating point
under representation.  But it is a pain to have to have to second guess
every use of Round().

--
Gordon Niessen
If you aren't on the bleeding edge, you are history.

Replies:

www.cryer.info
Managed Newsgroup Archive