round() function strange behaviour

Tim Peters tim.one at comcast.net
Mon Mar 11 14:31:08 EST 2002


[brobbins333 at shaw.ca]
> I understand and agree with what you are saying.  However,it is
> possible in some languages (VB, for example) to return a numerical
> result from a function with only two (or any other number) of decimal
> places.

The VB Currency type is a 64-bit signed integer under the covers, implicitly
scaled by 10,000.  That's similar to a FixedPoint(4) if you use my
FixedPoint.py class, although a FixedPoint(4) has no restriction on the
magnitude, while a VB Currency value is restricted to the range

    -922,337,203,685,477.5808 <= Currency <= 922,337,203,685,477.5807

You should re-read the responses you've gotten, because they're exactly on
target.  The details are everything here.





More information about the Python-list mailing list