mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
double comparison fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32375 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2258d6c8b7
commit
9a93ff4ceb
4 changed files with 56 additions and 81 deletions
|
@ -172,6 +172,14 @@ GSDecimalCompare(const GSDecimal *leftOperand, const GSDecimal *rightOperand)
|
|||
int s1 = leftOperand->exponent + leftOperand->length;
|
||||
int s2 = rightOperand->exponent + rightOperand->length;
|
||||
|
||||
if (leftOperand->validNumber != rightOperand->validNumber)
|
||||
{
|
||||
if (rightOperand->validNumber)
|
||||
return NSOrderedDescending;
|
||||
else
|
||||
return NSOrderedAscending;
|
||||
}
|
||||
|
||||
if (leftOperand->isNegative != rightOperand->isNegative)
|
||||
{
|
||||
if (rightOperand->isNegative)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue