picofuse-objc

NXNumber.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include "NXComparisonResult.h"
7 #include <stdint.h>
8 
13 int32_t NXRandInt32(void);
14 
19 uint32_t NXRandUnsignedInt32(void);
20 
25 int64_t NXRandInt64(void);
26 
31 uint64_t NXRandUnsignedInt64(void);
32 
52 @interface NXNumber : NXObject
53 
57 + (NXNumber *)numberWithBool:(BOOL)value;
58 
64 + (NXNumber *)numberWithInt16:(int16_t)value;
65 
71 + (NXNumber *)numberWithUnsignedInt16:(uint16_t)value;
72 
78 + (NXNumber *)numberWithInt32:(int32_t)value;
79 
85 + (NXNumber *)numberWithUnsignedInt32:(uint32_t)value;
86 
92 + (NXNumber *)numberWithInt64:(int64_t)value;
93 
99 + (NXNumber *)numberWithUnsignedInt64:(uint64_t)value;
100 
106 + (NXNumber *)numberWithFloat32:(float)value;
107 
113 + (NXNumber *)numberWithFloat64:(double)value;
114 
127 + (NXNumber *)numberWithString:(NXString *)string;
128 
132 + (NXNumber *)randomInt32;
133 
138 
142 + (NXNumber *)randomInt64;
143 
148 
152 + (NXNumber *)trueValue;
153 
157 + (NXNumber *)falseValue;
158 
162 + (NXNumber *)zeroValue;
163 
167 - (BOOL)boolValue;
168 
172 - (int16_t)int16Value;
173 
177 - (uint16_t)unsignedInt16Value;
178 
182 - (int32_t)int32Value;
183 
187 - (uint32_t)unsignedInt32Value;
188 
192 - (int64_t)int64Value;
193 
197 - (uint64_t)unsignedInt64Value;
198 
203 - (float)float32Value;
204 
208 - (double)float64Value;
209 
216 - (BOOL)isEqual:(id)anObject;
217 
224 - (NXComparisonResult)compare:(NXNumber *)other;
225 
230 - (uintptr_t)hash;
231 
237 - (NXString *)description;
238 
239 @end
An integer, floating point or boolean value, as an object.
Definition: NXNumber.h:52
int16_t int16Value()
Returns the value as a 16-bit signed integer.
NXNumber * randomUnsignedInt32()
Returns a number for a random 32-bit unsigned integer.
NXNumber * randomInt64()
Returns a number for a random 64-bit signed integer.
int64_t NXRandInt64(void)
Returns a random 64-bit signed integer.
int32_t NXRandInt32(void)
Returns a random 32-bit signed integer.
int64_t int64Value()
Returns the value as a 64-bit signed integer.
float float32Value()
Returns the value as a 32-bit floating point value, which is infinite if it&#39;s out of range...
uint32_t NXRandUnsignedInt32(void)
Returns a random 32-bit unsigned integer.
NXComparisonResult
The order of two objects.
uintptr_t hash()
Returns a hash of the value, which is the same for equal numbers, such as 1, 1.0 and true...
uint32_t unsignedInt32Value()
Returns the value as a 32-bit unsigned integer.
uint16_t unsignedInt16Value()
Returns the value as a 16-bit unsigned integer.
NXNumber * randomUnsignedInt64()
Returns a number for a random 64-bit unsigned integer.
NXNumber * falseValue()
Returns the number for false, which is equal to zero.
bool BOOL
A Boolean value.
Definition: runtime.h:60
NXNumber * zeroValue()
Returns the number for zero, as a signed integer.
NXString * description()
Returns the value as a string, which is "true" or "false" for a boolean.
A string of UTF-8 text.
Definition: NXString.h:53
Defines the NXComparisonResult type, for the result of a comparison.
NXNumber * randomInt32()
Returns a number for a random 32-bit signed integer.
The base class for objects in the Foundation framework.
Definition: NXObject.h:28
int32_t int32Value()
Returns the value as a 32-bit signed integer.
double float64Value()
Returns the value as a 64-bit floating point value.
uint64_t NXRandUnsignedInt64(void)
Returns a random 64-bit unsigned integer.
uint64_t unsignedInt64Value()
Returns the value as a 64-bit unsigned integer.
NXNumber * trueValue()
Returns the number for true, which is equal to one.
BOOL boolValue()
Returns YES if the value isn&#39;t zero.