class TRealX |
A class encapsulating an extended precision real value.
This class provides 64 bit precision and a dynamic range of approximately 1E-9863 to 1E+9863. All member functions are optimized for speed.
Public Member Functions | |
---|---|
TRealX () | |
TRealX ( TInt ) | |
TRealX ( TUint ) | |
TRealX ( TUint , TUint , TUint ) | |
TRealX (const TInt64 &) | |
TRealX ( TReal32 ) | |
TRealX ( TReal64 ) | |
IMPORT_C TInt | Add ( TRealX &, const TRealX &) |
IMPORT_C TInt | AddEq (const TRealX &) |
IMPORT_C TRealXOrder | Compare (const TRealX &) |
IMPORT_C TInt | Div ( TRealX &, const TRealX &) |
IMPORT_C TInt | DivEq (const TRealX &) |
IMPORT_C TInt | GetTReal ( TReal32 &) |
IMPORT_C TInt | GetTReal ( TReal64 &) |
IMPORT_C TBool | IsFinite () |
IMPORT_C TBool | IsInfinite () |
IMPORT_C TBool | IsNaN () |
IMPORT_C TBool | IsZero () |
IMPORT_C TInt | Mod ( TRealX &, const TRealX &) |
IMPORT_C TInt | ModEq (const TRealX &) |
IMPORT_C TInt | Mult ( TRealX &, const TRealX &) |
IMPORT_C TInt | MultEq (const TRealX &) |
IMPORT_C TInt | Set ( TInt ) |
IMPORT_C TInt | Set ( TUint ) |
IMPORT_C TInt | Set (const TInt64 &) |
IMPORT_C TInt | Set ( TReal32 ) |
IMPORT_C TInt | Set ( TReal64 ) |
IMPORT_C void | SetInfinite ( TBool ) |
IMPORT_C void | SetNaN () |
IMPORT_C void | SetZero ( TBool ) |
IMPORT_C TInt | Sub ( TRealX &, const TRealX &) |
IMPORT_C TInt | SubEq (const TRealX &) |
IMPORT_C | operator TInt () |
IMPORT_C | operator TInt64 () |
IMPORT_C | operator TReal32 () |
IMPORT_C | operator TReal64 () |
IMPORT_C | operator TUint () |
TBool | operator!= (const TRealX &) |
IMPORT_C TRealX | operator% (const TRealX &) |
IMPORT_C const TRealX & | operator%= (const TRealX &) |
IMPORT_C TRealX | operator* (const TRealX &) |
IMPORT_C const TRealX & | operator*= (const TRealX &) |
IMPORT_C TRealX | operator+ () |
IMPORT_C TRealX | operator+ (const TRealX &) |
IMPORT_C TRealX & | operator++ () |
IMPORT_C TRealX | operator++ ( TInt ) |
IMPORT_C const TRealX & | operator+= (const TRealX &) |
IMPORT_C TRealX | operator- () |
IMPORT_C TRealX | operator- (const TRealX &) |
IMPORT_C TRealX & | operator-- () |
IMPORT_C TRealX | operator-- ( TInt ) |
IMPORT_C const TRealX & | operator-= (const TRealX &) |
IMPORT_C TRealX | operator/ (const TRealX &) |
IMPORT_C const TRealX & | operator/= (const TRealX &) |
TBool | operator< (const TRealX &) |
TBool | operator<= (const TRealX &) |
IMPORT_C TRealX & | operator= ( TInt ) |
IMPORT_C TRealX & | operator= ( TUint ) |
IMPORT_C TRealX & | operator= (const TInt64 &) |
IMPORT_C TRealX & | operator= ( TReal32 ) |
IMPORT_C TRealX & | operator= ( TReal64 ) |
TBool | operator== (const TRealX &) |
TBool | operator> (const TRealX &) |
TBool | operator>= (const TRealX &) |
Public Member Enumerations | |
---|---|
enum | TRealXOrder { ELessThan = 1, EEqual = 2, EGreaterThan = 4, EUnordered = 8 } |
Public Attributes | |
---|---|
TUint16 | iExp |
TUint8 | iFlag |
TUint32 | iMantHi |
TUint32 | iMantLo |
TInt8 | iSign |
IMPORT_C | TRealX | ( | ) |
Constructs a default extended precision object.
This sets the value to zero.
IMPORT_C | TRealX | ( | TInt | aInt | ) |
Constructs an extended precision object from a signed integer value.
TInt aInt |
IMPORT_C | TRealX | ( | TUint | aInt | ) |
Constructs an extended precision object from an unsigned integer value.
TUint aInt |
IMPORT_C | TRealX | ( | TUint | aExp, |
TUint | aMantHi, | |||
TUint | aMantLo | |||
) |
Constructs an extended precision object from an explicit exponent and a 64 bit mantissa.
IMPORT_C | TRealX | ( | const TInt64 & | aInt | ) |
Constructs an extended precision object from a 64 bit integer.
const TInt64 & aInt |
IMPORT_C | TRealX | ( | TReal32 | aReal | ) |
Constructs an extended precision object from a single precision floating point number.
TReal32 aReal | The single precision floating point value. |
IMPORT_C | TRealX | ( | TReal64 | aReal | ) |
Constructs an extended precision object from a double precision floating point number.
TReal64 aReal | The double precision floating point value. |
IMPORT_C TInt | Add | ( | TRealX & | aResult, |
const TRealX & | aVal | |||
) | const |
Adds an extended precision value to this extended precision number.
IMPORT_C TInt | AddEq | ( | const TRealX & | aVal | ) |
Adds an extended precision value to this extended precision number.
const TRealX & aVal | The extended precision value to be added. |
IMPORT_C TRealXOrder | Compare | ( | const TRealX & | aVal | ) | const |
const TRealX & aVal |
IMPORT_C TInt | Div | ( | TRealX & | aResult, |
const TRealX & | aVal | |||
) | const |
Divides this extended precision number by an extended precision value.
IMPORT_C TInt | DivEq | ( | const TRealX & | aVal | ) |
Divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
IMPORT_C TInt | GetTReal | ( | TReal32 & | aVal | ) | const |
Extracts the extended precision value as a single precision floating point value.
TReal32 & aVal | A reference to a single precision object which contains the result of the operation. |
IMPORT_C TInt | GetTReal | ( | TReal64 & | aVal | ) | const |
Extracts the extended precision value as a double precision floating point value.
TReal64 & aVal | A reference to a double precision object which contains the result of the operation. |
IMPORT_C TBool | IsFinite | ( | ) | const |
Determines whether the extended precision value has a finite value.
IMPORT_C TBool | IsInfinite | ( | ) | const |
Determines whether the extended precision value has a finite value.
IMPORT_C TBool | IsNaN | ( | ) | const |
Determines whether the extended precision value is 'not a number'.
IMPORT_C TInt | Mod | ( | TRealX & | aResult, |
const TRealX & | aVal | |||
) | const |
Modulo-divides this extended precision number by an extended precision value.
IMPORT_C TInt | ModEq | ( | const TRealX & | aVal | ) |
Modulo-divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
IMPORT_C TInt | Mult | ( | TRealX & | aResult, |
const TRealX & | aVal | |||
) | const |
Multiplies this extended precision number by an extended precision value.
IMPORT_C TInt | MultEq | ( | const TRealX & | aVal | ) |
Multiplies this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the multiplier. |
IMPORT_C TInt | Set | ( | TInt | aInt | ) |
Gives this extended precision object a new value taken from a signed integer.
TInt aInt |
IMPORT_C TInt | Set | ( | TUint | aInt | ) |
Gives this extended precision object a new value taken from an unsigned integer.
TUint aInt |
IMPORT_C TInt | Set | ( | const TInt64 & | aInt | ) |
Gives this extended precision object a new value taken from a 64 bit integer.
const TInt64 & aInt |
IMPORT_C TInt | Set | ( | TReal32 | aReal | ) |
Gives this extended precision object a new value taken from a single precision floating point number.
TReal32 aReal | The single precision floating point value. |
IMPORT_C TInt | Set | ( | TReal64 | aReal | ) |
Gives this extended precision object a new value taken from a double precision floating point number.
TReal64 aReal | The double precision floating point value. |
IMPORT_C void | SetInfinite | ( | TBool | aNegative | ) |
Sets the value of this extended precision object to infinity.
TBool aNegative | ETrue, the value is a negative zero; EFalse, the value is a positive zero. |
IMPORT_C void | SetNaN | ( | ) |
Sets the value of this extended precision object to 'not a number'.
IMPORT_C void | SetZero | ( | TBool | aNegative = EFalse | ) |
Sets the value of this extended precision object to zero.
TBool aNegative = EFalse | ETrue, the value is a negative zero; EFalse, the value is a positive zero, this is the default. |
IMPORT_C TInt | Sub | ( | TRealX & | aResult, |
const TRealX & | aVal | |||
) | const |
Subtracts an extended precision value from this extended precision number.
IMPORT_C TInt | SubEq | ( | const TRealX & | aVal | ) |
Subtracts an extended precision value from this extended precision number.
const TRealX & aVal | The extended precision value to be subtracted. |
IMPORT_C | operator TInt | ( | ) | const |
Gets the extended precision value as a signed integer value.
The operator returns:
1. zero , if the extended precision value is not a number
2. 0x7FFFFFFF, if the value is positive and too big to fit into a TInt.
3. 0x80000000, if the value is negative and too big to fit into a TInt.
IMPORT_C | operator TInt64 | ( | ) | const |
Returns the extended precision value as a 64 bit integer value.
The operator returns:
1. zero, if the extended precision value is not a number
2. 0x7FFFFFFF FFFFFFFF, if the value is positive and too big to fit into a TInt64
3. 0x80000000 00000000, if the value is negative and too big to fit into a TInt.
IMPORT_C | operator TReal32 | ( | ) | const |
Returns the extended precision value as a single precision floating point value.
IMPORT_C | operator TReal64 | ( | ) | const |
Returns the extended precision value as a double precision floating point value.
IMPORT_C | operator TUint | ( | ) | const |
Returns the extended precision value as an unsigned signed integer value.
The operator returns:
1. zero, if the extended precision value is not a number
2. 0xFFFFFFFF, if the value is positive and too big to fit into a TUint.
3. zero, if the value is negative and too big to fit into a TUint.
TBool | operator!= | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for in-equality with another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
IMPORT_C TRealX | operator% | ( | const TRealX & | aVal | ) | const |
Modulo-divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
IMPORT_C const TRealX & | operator%= | ( | const TRealX & | aVal | ) |
Modulo-divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
IMPORT_C TRealX | operator* | ( | const TRealX & | aVal | ) | const |
Multiplies this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the multiplier. |
IMPORT_C const TRealX & | operator*= | ( | const TRealX & | aVal | ) |
Multiplies this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be subtracted. |
IMPORT_C TRealX | operator+ | ( | ) | const |
Returns this extended precision number unchanged.
Note that this may also be referred to as a unary plus operator.
IMPORT_C TRealX | operator+ | ( | const TRealX & | aVal | ) | const |
Adds an extended precision value to this extended precision number.
const TRealX & aVal | The extended precision value to be added. |
IMPORT_C TRealX & | operator++ | ( | ) |
Increments this extended precision number by one, and then returns a reference to it.
This is also referred to as a prefix operator.
IMPORT_C TRealX | operator++ | ( | TInt | ) |
Returns this extended precision number before incrementing it by one.
This is also referred to as a postfix operator.
TInt |
IMPORT_C const TRealX & | operator+= | ( | const TRealX & | aVal | ) |
Adds an extended precision value to this extended precision number.
const TRealX & aVal | The extended precision value to be added. |
IMPORT_C TRealX | operator- | ( | ) | const |
Negates this extended precision number.
This may also be referred to as a unary minus operator.
IMPORT_C TRealX | operator- | ( | const TRealX & | aVal | ) | const |
Subtracts an extended precision value from this extended precision number.
const TRealX & aVal | The extended precision value to be subtracted. |
IMPORT_C TRealX & | operator-- | ( | ) |
Decrements this extended precision number by one, and then returns a reference to it.
This is also referred to as a prefix operator.
IMPORT_C TRealX | operator-- | ( | TInt | ) |
Returns this extended precision number before decrementing it by one.
This is also referred to as a postfix operator.
TInt |
IMPORT_C const TRealX & | operator-= | ( | const TRealX & | aVal | ) |
Subtracts an extended precision value from this extended precision number.
const TRealX & aVal | The extended precision value to be subtracted. |
IMPORT_C TRealX | operator/ | ( | const TRealX & | aVal | ) | const |
Divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
IMPORT_C const TRealX & | operator/= | ( | const TRealX & | aVal | ) |
Divides this extended precision number by an extended precision value.
const TRealX & aVal | The extended precision value to be used as the divisor. |
TBool | operator< | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for being less than another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
TBool | operator<= | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for being less than or equal to another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
IMPORT_C TRealX & | operator= | ( | TInt | aInt | ) |
Assigns the specified signed integer value to this extended precision object.
TInt aInt |
IMPORT_C TRealX & | operator= | ( | TUint | aInt | ) |
Assigns the specified unsigned integer value to this extended precision object.
TUint aInt |
IMPORT_C TRealX & | operator= | ( | const TInt64 & | aInt | ) |
Assigns the specified 64 bit integer value to this extended precision object.
const TInt64 & aInt |
IMPORT_C TRealX & | operator= | ( | TReal32 | aReal | ) |
Assigns the specified single precision floating point number to this extended precision object.
TReal32 aReal | The single precision floating point value. |
IMPORT_C TRealX & | operator= | ( | TReal64 | aReal | ) |
Assigns the specified double precision floating point number to this extended precision object.
TReal64 aReal | The double precision floating point value. |
TBool | operator== | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for equality with another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
TBool | operator> | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for being greater than another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
TBool | operator>= | ( | const TRealX & | aVal | ) | const [inline] |
Compares this extended precision number for being greater than or equal to another.
const TRealX & aVal | A reference to the extended precision value to be compared. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.