Decimal arithmatic, was Re: Python GUI app to impress the boss?

James J. Besemer jb at cascade-sys.com
Tue Oct 1 05:24:48 EDT 2002


Paul Rubin wrote:

>How about just adding a small amount before rounding at the end?
>
>  
>
>>>>(.70 * .05) + .000000001
>>>>        
>>>>
>
>rounds to the right thing.
>  
>
Nope.  It helps in some cases but introduces errors in other cases 
(e.g., negative numbers).

--jb

-- 
James J. Besemer		503-280-0838 voice
2727 NE Skidmore St.		503-280-0375 fax
Portland, Oregon 97211-6557	mailto:jb at cascade-sys.com
				http://cascade-sys.com	








More information about the Python-list mailing list