activemq-cpp-3.6.0
|
#include <src/main/decaf/lang/Double.h>
Public Member Functions | |
Double (double value) | |
Constructs a new instance of a Double object and assigns it the given value. | |
Double (const std::string &value) | |
Constructs a new Double and attempts to convert the given string to a double value, assigning it to the new object is successful or throwing a NumberFormatException if the string is not a properly formatted double. | |
virtual | ~Double () |
virtual int | compareTo (const Double &d) const |
Compares this Double instance with another. | |
bool | equals (const Double &d) const |
virtual bool | operator== (const Double &d) const |
Compares equality between this object and the one passed. | |
virtual bool | operator< (const Double &d) const |
Compares this object to another and returns true if this object is considered to be less than the one passed. | |
virtual int | compareTo (const double &d) const |
Compares this Double instance with another. | |
bool | equals (const double &d) const |
virtual bool | operator== (const double &d) const |
Compares equality between this object and the one passed. | |
virtual bool | operator< (const double &d) const |
Compares this object to another and returns true if this object is considered to be less than the one passed. | |
std::string | toString () const |
virtual double | doubleValue () const |
Answers the double value which the receiver represents. | |
virtual float | floatValue () const |
Answers the float value which the receiver represents. | |
virtual unsigned char | byteValue () const |
Answers the byte value which the receiver represents. | |
virtual short | shortValue () const |
Answers the short value which the receiver represents. | |
virtual int | intValue () const |
Answers the int value which the receiver represents. | |
virtual long long | longValue () const |
Answers the long value which the receiver represents. | |
bool | isInfinite () const |
bool | isNaN () const |
![]() | |
virtual | ~Number () |
![]() | |
virtual | ~Comparable () |
![]() | |
virtual | ~Comparable () |
Static Public Member Functions | |
static int | compare (double d1, double d2) |
Compares the two specified double values. | |
static long long | doubleToLongBits (double value) |
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout. | |
static long long | doubleToRawLongBits (double value) |
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout, preserving Not-a-Number (NaN) values. | |
static bool | isInfinite (double value) |
static bool | isNaN (double value) |
static double | longBitsToDouble (long long bits) |
Returns the double value corresponding to a given bit representation. | |
static double | parseDouble (const std::string value) |
Returns a new double initialized to the value represented by the specified string, as performed by the valueOf method of class Double. | |
static std::string | toHexString (double value) |
Returns a hexadecimal string representation of the double argument. | |
static std::string | toString (double value) |
Returns a string representation of the double argument. | |
static Double | valueOf (double value) |
Returns a Double instance representing the specified double value. | |
static Double | valueOf (const std::string &value) |
Returns a Double instance that wraps a primtive double which is parsed from the string value passed. |
Static Public Attributes | |
static const int | SIZE = 64 |
The size in bits of the primitive int type. | |
static const double | MAX_VALUE |
The maximum value that the primitive type can hold. | |
static const double | MIN_VALUE |
The minimum value that the primitive type can hold. | |
static const double | NaN |
Constant for the Not a Number Value. | |
static const double | POSITIVE_INFINITY |
Constant for Positive Infinity. | |
static const double | NEGATIVE_INFINITY |
Constant for Negative Infinitiy. |
decaf::lang::Double::Double | ( | double | value | ) |
Constructs a new instance of a Double object and assigns it the given value.
value | The primitive type to wrap. |
decaf::lang::Double::Double | ( | const std::string & | value | ) |
Constructs a new Double and attempts to convert the given string to a double value, assigning it to the new object is successful or throwing a NumberFormatException if the string is not a properly formatted double.
value | The string to convert to a primitive type to wrap. |
NumberFormatException | if the string is not a a valid double. |
|
inlinevirtual |
|
inlinevirtual |
Answers the byte value which the receiver represents.
Reimplemented from decaf::lang::Number.
|
static |
Compares the two specified double values.
The sign of the integer value returned is the same as that of the integer that would be returned by the call: new Double(d1).compareTo(new Double(d2))
d1 | - the first double to compare |
d2 | - the second double to compare |
Compares this Double instance with another.
d | - the Double instance to be compared |
Implements decaf::lang::Comparable< Double >.
|
virtual |
Compares this Double instance with another.
d | - the Double instance to be compared |
Implements decaf::lang::Comparable< double >.
|
static |
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.
Bit 63 (the bit that is selected by the mask 0x8000000000000000L) represents the sign of the floating-point number. Bits 62-52 (the bits that are selected by the mask 0x7ff0000000000000L) represent the exponent. Bits 51-0 (the bits that are selected by the mask 0x000fffffffffffffL) represent the significand (sometimes called the mantissa) of the floating-point number.
If the argument is positive infinity, the result is 0x7ff0000000000000L. If the argument is negative infinity, the result is 0xfff0000000000000L. If the argument is NaN, the result is 0x7ff8000000000000L.
In all cases, the result is a long integer that, when given to the longBitsToDouble(long) method, will produce a floating-point value the same as the argument to doubleToLongBits (except all NaN values are collapsed to a single "canonical" NaN value).
value | - double to be converted |
Referenced by decaf::util::HashCode< double >::operator()().
|
static |
Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout, preserving Not-a-Number (NaN) values.
Bit 63 (the bit that is selected by the mask 0x8000000000000000LL) represents the sign of the floating-point number. Bits 62-52 (the bits that are selected by the mask 0x7ff0000000000000L) represent the exponent. Bits 51-0 (the bits that are selected by the mask 0x000fffffffffffffL) represent the significand (sometimes called the mantissa) of the floating-point number.
If the argument is positive infinity, the result is 0x7ff0000000000000LL. If the argument is negative infinity, the result is 0xfff0000000000000LL. If the argument is NaN, the result is the long integer representing the actual NaN value. Unlike the doubleToLongBits method, doubleToRawLongBits does not collapse all the bit patterns encoding a NaN to a single "canonical" NaN value.
In all cases, the result is a long integer that, when given to the longBitsToDouble(long) method, will produce a floating-point value the same as the argument to doubleToRawLongBits.
value | - double to be converted |
|
inlinevirtual |
Answers the double value which the receiver represents.
Implements decaf::lang::Number.
d | - the Double object to compare against. |
Implements decaf::lang::Comparable< Double >.
|
inlinevirtual |
d | - the Double object to compare against. |
Implements decaf::lang::Comparable< double >.
|
inlinevirtual |
Answers the float value which the receiver represents.
Implements decaf::lang::Number.
|
inlinevirtual |
Answers the int value which the receiver represents.
Implements decaf::lang::Number.
bool decaf::lang::Double::isInfinite | ( | ) | const |
|
static |
value | - The double to check. |
bool decaf::lang::Double::isNaN | ( | ) | const |
|
static |
value | - The double to check. |
|
static |
Returns the double value corresponding to a given bit representation.
The argument is considered to be a representation of a floating-point value according to the IEEE 754 floating-point "double format" bit layout.
If the argument is 0x7ff0000000000000L, the result is positive infinity. If the argument is 0xfff0000000000000L, the result is negative infinity. If the argument is any value in the range 0x7ff0000000000001L through 0x7fffffffffffffffL or in the range 0xfff0000000000001L through 0xffffffffffffffffL, the result is a NaN. No IEEE 754 floating-point operation provided by C++ can distinguish between two NaN values of the same type with different bit patterns. Distinct values of NaN are only distinguishable by use of the Double.doubleToRawLongBits method.
bits | - the long long bits to convert to double |
|
inlinevirtual |
Answers the long value which the receiver represents.
Implements decaf::lang::Number.
Compares this object to another and returns true if this object is considered to be less than the one passed.
This
d | - the value to be compared to this one. |
Implements decaf::lang::Comparable< Double >.
|
inlinevirtual |
Compares this object to another and returns true if this object is considered to be less than the one passed.
This
d | - the value to be compared to this one. |
Implements decaf::lang::Comparable< double >.
Compares equality between this object and the one passed.
d | - the value to be compared to this one. |
Implements decaf::lang::Comparable< Double >.
|
inlinevirtual |
Compares equality between this object and the one passed.
d | - the value to be compared to this one. |
Implements decaf::lang::Comparable< double >.
|
static |
Returns a new double initialized to the value represented by the specified string, as performed by the valueOf method of class Double.
value | - The string to parse to an double |
NumberFormatException |
|
inlinevirtual |
Answers the short value which the receiver represents.
Reimplemented from decaf::lang::Number.
|
static |
Returns a hexadecimal string representation of the double argument.
All characters mentioned below are ASCII characters.
value | - The double to convert to a string |
std::string decaf::lang::Double::toString | ( | ) | const |
|
static |
Returns a string representation of the double argument.
All characters mentioned below are ASCII characters.
If the argument is NaN, the result is the string "NaN". Otherwise, the result is a string that represents the sign and magnitude (absolute value) of the argument. If the sign is negative, the first character of the result is '-'; if the sign is positive, no sign character appears in the result. As for the magnitude m: o If m is infinity, it is represented by the characters "Infinity"; thus, positive infinity produces the result "Infinity" and negative infinity produces the result "-Infinity". o If m is zero, it is represented by the characters "0.0"; thus, negative zero produces the result "-0.0" and positive zero produces the result "0.0". o If m is greater than or equal to 10-3 but less than 107, then it is represented as the integer part of m, in decimal form with no leading zeroes, followed by '.', followed by one or more decimal digits representing the fractional part of m. o If m is less than 10-3 or greater than or equal to 107, then it is represented in so-called "computerized scientific notation." Let n be the unique integer such that 10n <= m < 10n+1; then let a be the mathematically exact quotient of m and 10n so that 1 <= a < 10. The magnitude is then represented as the integer part of a, as a single decimal digit, followed by '.', followed by decimal digits representing the fractional part of a, followed by the letter 'E', followed by a representation of n as a decimal integer, as produced by the method Integer.toString(int).
value | - The double to convert to a string |
|
static |
|
static |
The maximum value that the primitive type can hold.
|
static |
The minimum value that the primitive type can hold.
|
static |
Constant for Negative Infinitiy.
|
static |
Constant for Positive Infinity.
|
static |
The size in bits of the primitive int type.