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:
fredkiefer 2007-10-09 22:44:20 +00:00
parent 409b3830fa
commit 869702f8a7
2 changed files with 7 additions and 1 deletions

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;