Jean-Michel Cazaux
1998-08-25 15:26:46 UTC
Hi folks,
I'm encountering a little problem with NSDecimalNumber (don't think this the best Apple-Next did...)
1) At the opposite of what is written is the doc, an arithmetic operation with a NSDecimalNumber whose value is notANumber produce an overflow exception.
Ex : [[NSDecimalNumber notANumber] decimalNumberBySubtracting:[NSDecimalNumber one]] produce "NSDecimalNumber overflow exception"
2) To prevent the exception, I'd like to check NSDecimalNumbers I'm applying an operation on...
But, the following test always returns YES, whatever is the value of 'anyNumber' :
[anyNumber isEqual:[NSDecimalNumber notANumber]]
I also tried compare and isEqualTo methods, and they gave the same results...
Any idea on how to workaround this...
Thanks in advance for any help...
PS : we are using OpenStep Enterprise 4.2 on NT
__________________________________________________________________________________________
Jean-Michel CAZAUX
FININDEV, Conseil en Finances pour les Collectivités Locales.
204 Rue Michel Teule - ZAC d'Alco
34080 Montpellier - FRANCE - EU.
Tél. +33 (0)4 67 63 66 25 - Fax +33 (0)4 67 63 35 45
e-mail ***@finindev.com
I'm encountering a little problem with NSDecimalNumber (don't think this the best Apple-Next did...)
1) At the opposite of what is written is the doc, an arithmetic operation with a NSDecimalNumber whose value is notANumber produce an overflow exception.
Ex : [[NSDecimalNumber notANumber] decimalNumberBySubtracting:[NSDecimalNumber one]] produce "NSDecimalNumber overflow exception"
2) To prevent the exception, I'd like to check NSDecimalNumbers I'm applying an operation on...
But, the following test always returns YES, whatever is the value of 'anyNumber' :
[anyNumber isEqual:[NSDecimalNumber notANumber]]
I also tried compare and isEqualTo methods, and they gave the same results...
Any idea on how to workaround this...
Thanks in advance for any help...
PS : we are using OpenStep Enterprise 4.2 on NT
__________________________________________________________________________________________
Jean-Michel CAZAUX
FININDEV, Conseil en Finances pour les Collectivités Locales.
204 Rue Michel Teule - ZAC d'Alco
34080 Montpellier - FRANCE - EU.
Tél. +33 (0)4 67 63 66 25 - Fax +33 (0)4 67 63 35 45
e-mail ***@finindev.com