18 #ifndef _DECAF_LANG_FLOAT_H_
19 #define _DECAF_LANG_FLOAT_H_
50 static const float NaN;
85 virtual int compareTo(
const Float& f)
const;
92 return this->value == f.value;
101 return this->value == f.value;
111 return this->value < f.value;
122 virtual int compareTo(
const float& f)
const;
129 return this->value == f;
138 return this->value == f;
148 return this->value < f;
154 std::string toString()
const;
161 return (
double) this->value;
177 return (
unsigned char) this->value;
185 return (
short) this->value;
193 return (
int) this->value;
201 return (
long long) this->value;
207 bool isInfinite()
const;
227 static int compare(
float f1,
float f2);
250 static int floatToIntBits(
float value);
277 static int floatToRawIntBits(
float value);
296 static float intBitsToFloat(
int bits);
302 static bool isInfinite(
float value);
312 static bool isNaN(
float value);
325 static float parseFloat(
const String& value);
361 static std::string toHexString(
float value);
397 static std::string toString(
float value);
404 static Float valueOf(
float value);
418 static const unsigned int SINGLE_EXPONENT_MASK;
419 static const unsigned int SINGLE_MANTISSA_MASK;
420 static const unsigned int SINGLE_NAN_BITS;
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Float.h:192
virtual bool operator==(const Float &f) const
Compares equality between this object and the one passed.
Definition: Float.h:100
bool equals(const Float &f) const
Definition: Float.h:91
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition: Float.h:168
static const float NEGATIVE_INFINITY
Constant for Negative Infinity.
Definition: Float.h:56
static const float NaN
Constant for the Not a Number Value.
Definition: Float.h:50
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Float.h:200
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition: Float.h:184
virtual bool operator<(const float &f) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Float.h:147
An immutable sequence of characters.
Definition: String.h:57
#define DECAF_API
Definition: Config.h:29
static const float MAX_VALUE
The maximum value that the primitive type can hold.
Definition: Float.h:44
static const int SIZE
The size in bits of the primitive int type.
Definition: Float.h:41
static const float MIN_VALUE
The minimum value that the primitive type can hold.
Definition: Float.h:47
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Float.h:176
static const float POSITIVE_INFINITY
Constant for Positive Infinity.
Definition: Float.h:53
virtual ~Float()
Definition: Float.h:75
virtual bool operator<(const Float &f) const
Compares this object to another and returns true if this object is considered to be less than the one...
Definition: Float.h:110
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Float.h:160
bool equals(const float &f) const
Definition: Float.h:128
virtual bool operator==(const float &f) const
Compares equality between this object and the one passed.
Definition: Float.h:137
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33