81 return self->
value ? true :
false;
89 return (
char) self->
value;
122 return (
float) self->
value;
144 return (
int) self->
value;
152 return (
long) self->
value;
168 return (
short) self->
value;
171#pragma mark - Class lifecycle
206 .instanceSize =
sizeof(
Number),
207 .interfaceOffset = offsetof(
Number, interface),
208 .interfaceSize =
sizeof(NumberInterface),
static Array * init(Array *self)
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define alloc(type)
Allocate and initialize and instance of type.
#define super(type, obj, method,...)
int HashForDecimal(int hash, const double decimal)
Accumulates the hash value of decimal into hash.
Utilities for calculating hash values.
#define HASH_SEED
The hash seed value.
static Number * numberWithValue(double value)
static char charValue(const Number *self)
static double doubleValue(const Number *self)
static bool isEqual(const Object *self, const Object *other)
static Order compareTo(const Number *self, const Number *other)
static short shortValue(const Number *self)
static String * description(const Object *self)
static Number * initWithValue(Number *self, const double value)
static long longValue(const Number *self)
static bool boolValue(const Number *self)
static float floatValue(const Number *self)
static void initialize(Class *clazz)
static int intValue(const Number *self)
static int hash(const Object *self)
A wrapper for placing numeric primitives into collections, etc.
Order
Comparison constants.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
ident interface
The interface of the Class.
A wrapper for placing numeric primitives into collections, etc.
short shortValue(const Number *self)
double value
The backing value.
int intValue(const Number *self)
Object is the root Class of The Objectively Class hierarchy.
Class * clazz
Every instance of Object begins with a pointer to its Class.
int hash(const Object *self)