18 #ifndef _DECAF_LANG_FLOAT_H_ 19 #define _DECAF_LANG_FLOAT_H_ 49 static const float NaN;
67 Float(
double value );
72 Float(
const std::string& value );
84 virtual int compareTo(
const Float& f )
const;
91 return this->value == f.value;
100 return this->value == f.value;
110 return this->value < f.value;
121 virtual int compareTo(
const float& f )
const;
128 return this->value == f;
137 return this->value == f;
147 return this->value < f;
153 std::string toString()
const;
160 return (
double)this->value;
176 return (
unsigned char)this->value;
184 return (
short)this->value;
192 return (
int)this->value;
200 return (
long long)this->value;
206 bool isInfinite()
const;
225 static int compare(
float f1,
float f2 );
248 static int floatToIntBits(
float value );
275 static int floatToRawIntBits(
float value );
294 static float intBitsToFloat(
int bits );
300 static bool isInfinite(
float value );
306 static bool isNaN(
float value );
315 static float parseFloat(
const std::string& value );
351 static std::string toHexString(
float value );
384 static std::string toString(
float value );
391 static Float valueOf(
float value );
401 static Float valueOf(
const std::string& value );
405 static const unsigned int SINGLE_EXPONENT_MASK = 0x7F800000;
406 static const unsigned int SINGLE_MANTISSA_MASK = 0x007FFFFF;
407 static const unsigned int SINGLE_NAN_BITS = (SINGLE_EXPONENT_MASK | 0x00400000);
virtual bool operator==(const float &f) const
Compares equality between this object and the one passed.
Definition: Float.h:136
virtual float floatValue() const
Answers the float value which the receiver represents.
Definition: Float.h:167
bool equals(const float &f) const
Definition: Float.h:127
static const float NEGATIVE_INFINITY
Constant for Negative Infinity.
Definition: Float.h:55
static const float NaN
Constant for the Not a Number Value.
Definition: Float.h:49
virtual long long longValue() const
Answers the long value which the receiver represents.
Definition: Float.h:199
virtual short shortValue() const
Answers the short value which the receiver represents.
Definition: Float.h:183
The abstract class Number is the superclass of classes Byte, Double, Float, Integer, Long, and Short.
Definition: Number.h:35
virtual bool operator==(const Float &f) const
Compares equality between this object and the one passed.
Definition: Float.h:99
virtual double doubleValue() const
Answers the double value which the receiver represents.
Definition: Float.h:159
bool equals(const Float &f) const
Definition: Float.h:90
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:109
#define DECAF_API
Definition: Config.h:29
static const float MAX_VALUE
The maximum value that the primitive type can hold.
Definition: Float.h:43
static const int SIZE
The size in bits of the primitive int type.
Definition: Float.h:40
static const float MIN_VALUE
The minimum value that the primitive type can hold.
Definition: Float.h:46
virtual unsigned char byteValue() const
Answers the byte value which the receiver represents.
Definition: Float.h:175
virtual int intValue() const
Answers the int value which the receiver represents.
Definition: Float.h:191
static const float POSITIVE_INFINITY
Constant for Positive Infinity.
Definition: Float.h:52
virtual ~Float()
Definition: Float.h:74
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:146
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25