mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/NSDecimalNumber.m
(NSDecimalNumberClass): Added local class cache. ([+initialize]): Initialize new cache. ([-compare]): Test for all subclasses instead of only NSDecimalNumber instances. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25656 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b6fde8d6fa
commit
4dc6d57181
2 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,11 @@
|
|||
* Source/NSDecimalNumber.m ([initWithBytes:objCType:]): Implement
|
||||
initialization with scalar types. Use GSPrivateDefaultLocale
|
||||
to initialze intermediate string to match expectations of
|
||||
initWithString.
|
||||
initWithString.
|
||||
(NSDecimalNumberClass): Added local class cache.
|
||||
([+initialize]): Initialize new cache.
|
||||
([-compare]): Test for all subclasses instead of only NSDecimalNumber
|
||||
instances.
|
||||
|
||||
2007-11-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ static NSDecimalNumberHandler *handler;
|
|||
|
||||
@implementation NSDecimalNumber
|
||||
|
||||
static Class NSDecimalNumberClass;
|
||||
static NSDecimalNumber *maxNumber;
|
||||
static NSDecimalNumber *minNumber;
|
||||
static NSDecimalNumber *notANumber;
|
||||
|
@ -166,6 +167,7 @@ static NSDecimalNumber *one;
|
|||
one = [[self alloc] initWithMantissa: 1
|
||||
exponent: 0
|
||||
isNegative: NO];
|
||||
NSDecimalNumberClass = [NSDecimalNumber class];
|
||||
}
|
||||
|
||||
+ (id <NSDecimalNumberBehaviors>) defaultBehavior
|
||||
|
@ -583,7 +585,7 @@ static NSDecimalNumber *one;
|
|||
|
||||
- (NSComparisonResult) compare: (NSNumber*)decimalNumber
|
||||
{
|
||||
if ([decimalNumber isMemberOfClass: [self class]])
|
||||
if ([decimalNumber isKindOfClass: NSDecimalNumberClass])
|
||||
{
|
||||
NSDecimal d1 = [self decimalValue];
|
||||
NSDecimal d2 = [(NSDecimalNumber*)decimalNumber decimalValue];
|
||||
|
|
Loading…
Reference in a new issue