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 sets error 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;
  • 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;