Decimal arithmetic, with example code
Chris Gonnerman
chris.gonnerman at newcenturycomputers.net
Tue Oct 1 21:43:50 EDT 2002
More information about the Python-list mailing list
Tue Oct 1 21:43:50 EDT 2002
- Previous message (by thread): Decimal arithmetic, with example code
- Next message (by thread): Decimal arithmetic, with example code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
----- Original Message ----- From: "Paul Boddie" <paul at boddie.net> > Here are some example results from an extended > version of the original program: > > PCT AMT Fixed Fixed Fixed Scaled Scaled Float > 2dp 4dp -> 2dp 2dp 4dp << hack >> > 0.10 0.45 0.04 0.0450 0.04 0.05 0.0450 0.05 > 0.10 0.65 0.06 0.0650 0.06 0.07 0.0650 0.07 > 0.10 0.85 0.08 0.0850 0.08 0.09 0.0850 0.09 Whoops... can someone on the FixedPoint team explain this to me? When did 0.85 * 0.10, rounded to 2 places, become 0.08? It should be 0.09. Perhaps I misunderstood. Am I supposed to use higher precision and then lower it after computation? This isn't any better than floats. Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net http://newcenturycomputers.net
- Previous message (by thread): Decimal arithmetic, with example code
- Next message (by thread): Decimal arithmetic, with example code
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list