Bug 42196

GemStone/S 64 Bit

3.0.1, 3.0

No platform

3.1

ScaledDecimal flooring division can round in the wrong direction

The result of a numeric expression of the form "a // b" should always be
the integer that is the closest integer to the precise value of "a
/ b" in the negative direction. However, if "a" evaluates to a ScaledDecimal
and "b" evaluates toan integer or ScaledDecimal, it is possible for the
answer to be one greater than it should be. This happens in cases where
the precise value of "a / b", if rounded according to ScaledDecimal rounding
rules, would round to the next most positive integer.

Workaround

Convert either the receiver or the argument to a Fraction before sending #//.


Last updated: 4/24/12