RLMDecimal128
@interface RLMDecimal128 : NSObject
A 128-bit IEEE 754-2008 decimal floating point number.
This type is similar to Swift’s built-in Decimal type, but allocates bits differently, resulting in a different representable range. (NS)Decimal stores a significand of up to 38 digits long and an exponent from -128 to 127, while this type stores up to 34 digits of significand and an exponent from -6143 to 6144.
-
Creates a new zero-initialized decimal128.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Converts the given value to a RLMDecimal128.
The following types can be converted to RLMDecimal128:
- NSNumber
- NSString
- NSDecimalNumber
Passing a value with a type not in this list is a fatal error. Passing a string which cannot be parsed as a valid Decimal128 is a fatal error.
Declaration
Objective-C
- (nonnull instancetype)initWithValue:(nonnull id)value;
-
Converts the given number to a RLMDecimal128.
Declaration
Objective-C
- (nonnull instancetype)initWithNumber:(nonnull NSNumber *)number;
-
Parses the given string to a RLMDecimal128.
Returns
nil
and setserror
if the string cannot be parsed as a RLMDecimal128.Declaration
Objective-C
- (nullable instancetype)initWithString:(nonnull NSString *)string error:(NSError *_Nullable *_Nullable)error;
-
Converts the given number to a RLMDecimal128.
Declaration
Objective-C
+ (nonnull instancetype)decimalWithNumber:(nonnull NSNumber *)number;
-
The minimum value for RLMDecimal128.
Declaration
Objective-C
@property (readonly, copy, class) RLMDecimal128 *_Nonnull minimumDecimalNumber;
-
The maximum value for RLMDecimal128.
Declaration
Objective-C
@property (readonly, copy, class) RLMDecimal128 *_Nonnull maximumDecimalNumber;
-
Convert this value to a double. This is a lossy conversion.
Declaration
Objective-C
@property (readonly, nonatomic) double doubleValue;
-
Convert this value to a NSDecimal. This may be a lossy conversion.
Declaration
Objective-C
@property (readonly, nonatomic) NSDecimal decimalValue;
-
Convert this value to a string.
Declaration
Objective-C
@property (readonly, nonatomic) NSString *_Nonnull stringValue;
-
Gets if this Decimal128 represents a NaN value.
Declaration
Objective-C
@property (readonly, nonatomic) BOOL isNaN;
-
The magnitude of this RLMDecimal128.
Declaration
Objective-C
@property (readonly, nonatomic) RLMDecimal128 *_Nonnull magnitude;
-
Replaces this RLMDecimal128 value with its additive inverse.
Declaration
Objective-C
- (void)negate;
-
Adds the right hand side to the current value and returns the result.
Declaration
Objective-C
- (nonnull RLMDecimal128 *)decimalNumberByAdding: (nonnull RLMDecimal128 *)decimalNumber;
-
Divides the right hand side to the current value and returns the result.
Declaration
Objective-C
- (nonnull RLMDecimal128 *)decimalNumberByDividingBy: (nonnull RLMDecimal128 *)decimalNumber;
-
Subtracts the right hand side to the current value and returns the result.
Declaration
Objective-C
- (nonnull RLMDecimal128 *)decimalNumberBySubtracting: (nonnull RLMDecimal128 *)decimalNumber;
-
Multiply the right hand side to the current value and returns the result.
Declaration
Objective-C
- (nonnull RLMDecimal128 *)decimalNumberByMultiplyingBy: (nonnull RLMDecimal128 *)decimalNumber;
-
Comparision operator to check if the right hand side is greater than the current value.
Declaration
Objective-C
- (BOOL)isGreaterThan:(nullable RLMDecimal128 *)decimalNumber;
-
Comparision operator to check if the right hand side is greater than or equal to the current value.
Declaration
Objective-C
- (BOOL)isGreaterThanOrEqualTo:(nullable RLMDecimal128 *)decimalNumber;
-
Comparision operator to check if the right hand side is less than the current value.
Declaration
Objective-C
- (BOOL)isLessThan:(nullable RLMDecimal128 *)decimalNumber;
-
Comparision operator to check if the right hand side is less than or equal to the current value.
Declaration
Objective-C
- (BOOL)isLessThanOrEqualTo:(nullable RLMDecimal128 *)decimalNumber;