#include <e32math.h>
class TRealX |
Public Attributes | |
---|---|
TUint16 | iExp |
TUint8 | iFlag |
TUint32 | iMantHi |
TUint32 | iMantLo |
TInt8 | iSign |
Public Member Enumerations | |
---|---|
enum | TRealXOrder { ELessThan, EEqual, EGreaterThan, EUnordered } |
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.
TUint32 | iMantHi |
Enumerator | Value | Description |
---|---|---|
ELessThan | 1 | |
EEqual | 2 | |
EGreaterThan | 4 | |
EUnordered | 8 |
IMPORT_C | TRealX | ( | ) |
Constructs a default extended precision object.
This sets the value to zero.
IMPORT_C | TRealX | ( | TReal32 | aReal | ) |
Constructs an extended precision object from a single precision floating point number.
Parameters | |
---|---|
aReal | The single precision floating point value. |
IMPORT_C | TRealX | ( | TReal64 | aReal | ) |
Constructs an extended precision object from a double precision floating point number.
Parameters | |
---|---|
aReal | The double precision floating point value. |
Adds an extended precision value to this extended precision number.
Parameters | |
---|---|
aResult | On return, a reference to an extended precision object containing the result of the operation. |
aVal | The extended precision value to be added. |
Adds an extended precision value to this extended precision number.
Parameters | |
---|---|
aVal | The extended precision value to be added. |
IMPORT_C TRealXOrder | Compare | ( | const TRealX & | aVal | ) | const |
Divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aResult | On return, a reference to an extended precision object containing the result of the operation. |
aVal | The extended precision value to be used as the divisor. |
Divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Extracts the extended precision value as a single precision floating point value.
Parameters | |
---|---|
aVal | A reference to a single precision object which contains the result of the operation. |
Extracts the extended precision value as a double precision floating point value.
Parameters | |
---|---|
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 TBool | IsZero | ( | ) | const |
Determines whether the extended precision value is zero.
Modulo-divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aResult | On return, a reference to an extended precision object containing the result of the operation. |
aVal | The extended precision value to be used as the divisor. |
Modulo-divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Multiplies this extended precision number by an extended precision value.
Parameters | |
---|---|
aResult | On return, a reference to an extended precision object containing the result of the operation. |
aVal | The extended precision value to be used as the multiplier. |
Multiplies this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the multiplier. |
Gives this extended precision object a new value taken from a signed integer.
Gives this extended precision object a new value taken from an unsigned integer.
Gives this extended precision object a new value taken from a 64 bit integer.
Gives this extended precision object a new value taken from a single precision floating point number.
Parameters | |
---|---|
aReal | The single precision floating point value. |
Gives this extended precision object a new value taken from a double precision floating point number.
Parameters | |
---|---|
aReal | The double precision floating point value. |
IMPORT_C void | SetInfinite | ( | TBool | aNegative | ) |
Sets the value of this extended precision object to infinity.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aNegative | ETrue, the value is a negative zero; EFalse, the value is a positive zero, this is the default. |
Subtracts an extended precision value from this extended precision number.
Parameters | |
---|---|
aResult | On return, a reference to an extended precision object containing the result of the operation. |
aVal | The extended precision value to be subtracted. |
Subtracts an extended precision value from this extended precision number.
Parameters | |
---|---|
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.
Modulo-divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Panic Codes | |
---|---|
MATHX | KErrTotalLossOfPrecision if precision is lost. |
MATHX | KErrUnderflow if the operation results in underflow. |
Modulo-divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Panic Codes | |
---|---|
MATHX | KErrTotalLossOfPrecision panic if precision is lost. |
MATHX | KErrUnderflow if the operation results in underflow. |
Multiplies this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the multiplier. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Multiplies this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be subtracted. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
IMPORT_C TRealX | operator+ | ( | ) | const |
Returns this extended precision number unchanged.
Note that this may also be referred to as a unary plus operator.
Adds an extended precision value to this extended precision number.
Parameters | |
---|---|
aVal | The extended precision value to be added. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
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.
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Returns this extended precision number before incrementing it by one.
This is also referred to as a postfix operator.
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Adds an extended precision value to this extended precision number.
Parameters | |
---|---|
aVal | The extended precision value to be added. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
IMPORT_C TRealX | operator- | ( | ) | const |
Negates this extended precision number.
This may also be referred to as a unary minus operator.
Subtracts an extended precision value from this extended precision number.
Parameters | |
---|---|
aVal | The extended precision value to be subtracted. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
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.
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Returns this extended precision number before decrementing it by one.
This is also referred to as a postfix operator.
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Subtracts an extended precision value from this extended precision number.
Parameters | |
---|---|
aVal | The extended precision value to be subtracted. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
Divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
MATHX | KErrDivideByZero if the divisor is zero. |
Divides this extended precision number by an extended precision value.
Parameters | |
---|---|
aVal | The extended precision value to be used as the divisor. |
Panic Codes | |
---|---|
MATHX | KErrOverflow if the operation results in overflow. |
MATHX | KErrUnderflow if the operation results in underflow. |
MATHX | KErrDivideByZero if the divisor is zero. |
Compares this extended precision number for being less than or equal to another.
Parameters | |
---|---|
aVal | A reference to the extended precision value to be compared. |
Assigns the specified signed integer value to this extended precision object.
Assigns the specified unsigned integer value to this extended precision object.
Assigns the specified 64 bit integer value to this extended precision object.