Move check of over/underflow after copy. Patch by Mark Tracy

<tracy454@concentric.net>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25523 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-10-09 22:44:20 +00:00
parent 21735d34f4
commit 038ea67348
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2007-10-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSDecimal.m (NSDecimalMultiplyByPowerOf10): Move check of
over/underflow after copy. Patch by Mark Tracy <tracy454@concentric.net>.
2007-10-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: Fix ([-classForCoder:]) to return base class of

View file

@ -780,9 +780,10 @@ NSDecimalPower(NSDecimal *result, const NSDecimal *n, unsigned power, NSRounding
NSCalculationError
NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *n, short power, NSRoundingMode mode)
{
int p = result->exponent + power;
int p;
NSDecimalCopy(result, n);
p = result->exponent + power;
if (p > 127)
{
result->validNumber = NO;