Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47891-01

Float64 Class Reference

#include <coherence/lang/Float64.hpp>

Inherits Primitive< float64_t >, Number, and Comparable.

List of all members.


Detailed Description

An immutable 64-bit floating-point value.

Author:
jh 2008.04.01

Public Types

typedef spec::Handle Handle
 Float64 Handle definition.
typedef spec::View View
 Float64 View definition.
typedef spec::Holder Holder
 Float64 Holder definition.

Public Member Functions

virtual int16_t getInt16Value () const
 Return the numeric value of this object as an int16_t.

This may involve rounding or truncation.

Returns:
the numeric value of this object as an int16_t

virtual int32_t getInt32Value () const
 Return the numeric value of this object as an int32_t.

This may involve rounding or truncation.

Returns:
the numeric value of this object as an int32_t

virtual int64_t getInt64Value () const
 Return the numeric value of this object as an int64_t.

This may involve rounding or truncation.

Returns:
the numeric value of this object as an int64_t

virtual float32_t getFloat32Value () const
 Return the numeric value of this object as a float32_t.

This may involve rounding.

Returns:
the numeric value of this object as a float32_t

virtual float64_t getFloat64Value () const
 Return the numeric value of this object as a float64_t.

This may involve rounding.

Returns:
the numeric value of this object as a float64_t

virtual int32_t compareTo (Object::View v) const
 Compare this object with the specified object for order.

Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.

It is strongly recommended, but not strictly required, that (x->compareTo(y) == 0) == (x->equals(y)).

Parameters:
v the Object to be compared
Returns:
a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object
Exceptions:
ClassCastException if the specified Object's type prevents it from being compared to this Object

virtual bool equals (Object::View v) const
 Return true iff the specified Object is "equal" to this Object.

This method implements an equivalence relation on Objects:

  • It is reflexive: for any non-null handle h, h->equals(h) must return true.
  • It is symmetric: for any non-null handles h1 and h2, h1->equals(h2) should return true if and only if h2->equals(h1) returns true.
  • It is transitive: for any non-null handles h1, h2, and h3, if h1->equals(h2) returns true and h2->equals(h3) returns true, then h1->equals(h3) should return true.
  • It is consistent: for any non-null handles h1 and h2, multiple invocations of h1->equals(h2) consistently return true or consistently return false, provided no information used in comparisons on the objects is modified.
  • If the supplied handle is NULL then false must be returned.

The default implementation is a reference equality comparison.

Parameters:
v the Object::View to compare against, may be NULL
Returns:
true iff the given handle references an Object that is "equal" to this Object
See also:
equals(Object::View v1, Object::View v2)

virtual size32_t hashCode () const
 Return a hash code value for the Object.

This method is supported for the benefit of hash-based containers.

The general contract of hashCode is:

  • Whenever it is invoked on the same Object more than once during an execution of an application, the hashCode method must consistently return the same value, provided no information used in equals comparisons on the object is modified. This value need not remain consistent from one execution of an application to another execution of the same application.
  • If two Objects are equal according to the equals method, then calling the hashCode method on each of the two Objects must produce the same value.
  • It is not required that if two Objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct results. However, the programmer should be aware that producing distinct results for unequal objects may improve the performance of hash-based containers.

The default implementation is identity based.

Returns:
a hash code value for this Object


Static Public Member Functions

static uint64_t float64ToBits (float64_t dfl)
 Return a uint64_t representation of the specified 64-bit floating point value according to the IEEE 754 floating-point "double format" bit layout.
static float64_t bitsToFloat64 (uint64_t l)
 Return the float64_t value corresponding to a given bit representation.
static Handle valueOf (float64_t fl)
 Factory method to produce Float64 objects with an optimization that uses cached objects for all common numbers.
static bool isNaN (float64_t dfl)
 Test whether the given float64_t is a NaN.
static bool isZero (float64_t dfl)
 Test whether the given float64_t is -0.0 or 0.0.
static bool isInfinite (float64_t dfl)
 Test whether the given float64_t is -infinity or +infinity.
static int32_t compare (float64_t dfll, float64_t dflr)
 Compare the given float32_t values for order.
static float64_t getNaN ()
 Return a constant holding the Not-a-Number (NaN) value of type float64_t.
static float64_t getPositiveInfinity ()
 Return a constant holding the positive infinity value of type float64_t.
static float64_t getNegativeInfinity ()
 Returns a constant holding the negative infinity value of type float64_t.

Member Function Documentation

static uint64_t float64ToBits ( float64_t  dfl  )  [static]

Return a uint64_t representation of the specified 64-bit floating point value according to the IEEE 754 floating-point "double format" bit layout.

Parameters:
dfl a 64-bit floating-point number
Returns:
the uint64_t representation of the floating-point number

static float64_t bitsToFloat64 ( uint64_t  l  )  [static]

Return the float64_t value corresponding to a given bit representation.

The argument is considered to be a representation of a 64-bit floating-point value according to the IEEE 754 floating-point "double format" bit layout.

Parameters:
l a 64-bit unsigned integer containing the bit representation of the floating-point number
Returns:
the float64_t floating-point value with the same bit pattern.

static Handle valueOf ( float64_t  fl  )  [static]

Factory method to produce Float64 objects with an optimization that uses cached objects for all common numbers.

Parameters:
dfl a float64_t
Returns:
a Float64 whose value is the passed float64_t

static bool isNaN ( float64_t  dfl  )  [static]

Test whether the given float64_t is a NaN.

Parameters:
dfl a float64_t to test
Returns:
true if the given float64_t is a Nan, else return false

static bool isZero ( float64_t  dfl  )  [static]

Test whether the given float64_t is -0.0 or 0.0.

Parameters:
dfl a float64_t to test
Returns:
true if the given float64_t is a zero, else return false

static bool isInfinite ( float64_t  dfl  )  [static]

Test whether the given float64_t is -infinity or +infinity.

Parameters:
dfl a float64_t to test
Returns:
true if the given float64_t is infinity else return false

static int32_t compare ( float64_t  dfll,
float64_t  dflr 
) [static]

Compare the given float32_t values for order.

Return a negative integer, zero, or a positive integer if the left value is less than, equal to, or greater than the right. The comparison is based on the following order: -infinity < -0.0 < +0.0 < +infinity < NaN

Parameters:
dfll the left hand value to be compared
dflr the right hand value to be compared
Returns:
a negative integer, zero, or a positive integer if the left value is less than, equal to, or greater than the right value

static float64_t getNaN (  )  [static]

Return a constant holding the Not-a-Number (NaN) value of type float64_t.

It is equivalent to the value returned by Float64::bitsToFloat64(((uint64_t) 0x7FF80000) << 32).

Returns:
the float64_t NaN value

static float64_t getPositiveInfinity (  )  [static]

Return a constant holding the positive infinity value of type float64_t.

It is equal to the value returned by Float64::bitsToFloat64(((uint64_t) 0x7FF00000) << 32).

Returns:
the float64_t positive infinity value

static float64_t getNegativeInfinity (  )  [static]

Returns a constant holding the negative infinity value of type float64_t.

It is equal to the value returned by Float64::bitsToFloat64(((uint64_t) 0xFFF00000) << 32).

Returns:
the float64_t negative infinity value


The documentation for this class was generated from the following file:
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.