@@ -44,11 +44,11 @@ OF_SUBCLASSING_RESTRICTED #endif @interface OFNumber: OFValue { - union of_number_value { + union { double float_; long long signed_; unsigned long long unsigned_; } _value; const char *_typeEncoding; @@ -127,14 +127,14 @@ #ifdef OF_HAVE_UNAVAILABLE + (instancetype)valueWithBytes: (const void *)bytes objCType: (const char *)objCType OF_UNAVAILABLE; + (instancetype)valueWithPointer: (const void *)pointer OF_UNAVAILABLE; + (instancetype)valueWithNonretainedObject: (id)object OF_UNAVAILABLE; -+ (instancetype)valueWithRange: (of_range_t)range OF_UNAVAILABLE; -+ (instancetype)valueWithPoint: (of_point_t)point OF_UNAVAILABLE; -+ (instancetype)valueWithDimension: (of_dimension_t)dimension OF_UNAVAILABLE; -+ (instancetype)valueWithRectangle: (of_rectangle_t)rectangle OF_UNAVAILABLE; ++ (instancetype)valueWithRange: (OFRange)range OF_UNAVAILABLE; ++ (instancetype)valueWithPoint: (OFPoint)point OF_UNAVAILABLE; ++ (instancetype)valueWithSize: (OFSize)size OF_UNAVAILABLE; ++ (instancetype)valueWithRect: (OFRect)rect OF_UNAVAILABLE; #endif /** * @brief Creates a new OFNumber with the specified `bool`. * @@ -241,16 +241,10 @@ - (instancetype)init OF_UNAVAILABLE; #ifdef OF_HAVE_UNAVAILABLE - (instancetype)initWithBytes: (const void *)bytes objCType: (const char *)objCType OF_UNAVAILABLE; -- (instancetype)initWithPointer: (const void *)pointer OF_UNAVAILABLE; -- (instancetype)initWithNonretainedObject: (id)object OF_UNAVAILABLE; -- (instancetype)initWithRange: (of_range_t)range OF_UNAVAILABLE; -- (instancetype)initWithPoint: (of_point_t)point OF_UNAVAILABLE; -- (instancetype)initWithDimension: (of_dimension_t)dimension OF_UNAVAILABLE; -- (instancetype)initWithRectangle: (of_rectangle_t)rectangle OF_UNAVAILABLE; #endif /** * @brief Initializes an already allocated OFNumber with the specified `bool`. * @@ -359,13 +353,21 @@ * * @param value The `double` value which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithDouble: (double)value; + +/** + * @brief Compares the number to another number. + * + * @param number The number to compare the number to + * @return The result of the comparison + */ +- (OFComparisonResult)compare: (OFNumber *)number; @end OF_ASSUME_NONNULL_END #if !defined(NSINTEGER_DEFINED) && !__has_feature(modules) /* Required for number literals to work */ @compatibility_alias NSNumber OFNumber; #endif