#include <Numeric.hpp>
Inheritance diagram for Numeric:
Public Types | |
typedef RefCountPointer< const Numeric > | Ptr |
enum | State { NEG_INF = 0, NEG_NUM = 1, NUM = 2, INF = 3, NaN = 4 } |
Public Member Functions | |
virtual bool | isNumericValue () const |
virtual const XMLCh * | getPrimitiveTypeName () const =0 |
virtual const XMLCh * | getTypeURI () const =0 |
virtual const XMLCh * | getTypeName () const =0 |
virtual const XMLCh * | asString (const DynamicContext *context) const =0 |
virtual Numeric::Ptr | promoteTypeIfApplicable (const XMLCh *typeURI, const XMLCh *typeName, const DynamicContext *context) const =0 |
virtual bool | equals (const AnyAtomicType::Ptr &target, const DynamicContext *context) const |
virtual bool | lessThan (const Numeric::Ptr &other, const DynamicContext *context) const |
Returns true if this is less than other, false otherwise. | |
virtual bool | greaterThan (const Numeric::Ptr &other, const DynamicContext *context) const |
Returns true if this is greater than other, false otherwise. | |
virtual int | compare (const Numeric::Ptr &other, const DynamicContext *context) const |
Returns less than 0 if this is less that other, 0 if they are the same, and greater than 0 otherwise. | |
virtual Numeric::Ptr | add (const Numeric::Ptr &other, const DynamicContext *context) const =0 |
Returns a Numeric object which is the sum of this and other. | |
virtual Numeric::Ptr | subtract (const Numeric::Ptr &other, const DynamicContext *context) const =0 |
Returns a Numeric object which is the difference of this and other. | |
virtual Numeric::Ptr | multiply (const Numeric::Ptr &other, const DynamicContext *context) const =0 |
Returns a Numeric object which is the product of this and other. | |
virtual Numeric::Ptr | divide (const Numeric::Ptr &other, const DynamicContext *context) const =0 |
Returns a Numeric object which is the quotient of this and other. | |
virtual Numeric::Ptr | mod (const Numeric::Ptr &other, const DynamicContext *context) const =0 |
Returns the arithmetic product of its operands as a Numeric. | |
virtual Numeric::Ptr | floor (const DynamicContext *context) const =0 |
Returns the floor of this Numeric. | |
virtual Numeric::Ptr | ceiling (const DynamicContext *context) const =0 |
Returns the ceiling of this Numeric. | |
virtual Numeric::Ptr | round (const DynamicContext *context) const =0 |
Rounds this Numeric. | |
virtual Numeric::Ptr | roundHalfToEven (const Numeric::Ptr &precision, const DynamicContext *context) const =0 |
Rounds this Numeric to the given precision, and rounds a half to even. | |
virtual Numeric::Ptr | invert (const DynamicContext *context) const =0 |
Returns the Additive inverse of this Numeric. | |
virtual bool | isZero () const =0 |
Does this Numeric have value 0? | |
virtual bool | isPositive () const =0 |
Is this Numeric positive? | |
virtual bool | isNegative () const =0 |
Is this Numeric negative? | |
virtual bool | isNaN () const =0 |
virtual bool | isInfinite () const =0 |
virtual AnyAtomicType::AtomicObjectType | getPrimitiveTypeIndex () const =0 |
virtual const MAPM & | asMAPM () const =0 |
virtual State | getState () const =0 |
Static Public Member Functions | |
static void | checkFloatLimits (Numeric::State &state, MAPM &value) |
static void | checkDoubleLimits (Numeric::State &state, MAPM &value) |
static const XMLCh * | asDecimalString (const MAPM &value, int significantDigits, const StaticContext *context) |
static const XMLCh * | asDoubleString (State state, const MAPM &value, int significantDigits, const StaticContext *context) |
Static Public Attributes | |
static const XMLCh | NaN_string [] |
static const XMLCh | NAN_string [] |
static const XMLCh | INF_string [] |
static const XMLCh | NegINF_string [] |
static const XMLCh | NegZero_string [] |
static const XMLCh | PosZero_string [] |
Protected Member Functions | |
virtual AnyAtomicType::Ptr | castAsInternal (AtomicObjectType targetIndex, const XMLCh *targetURI, const XMLCh *targetType, const DynamicContext *context) const |
const XMLCh * | asDecimalString (int significantDigits, const StaticContext *context) const |
const XMLCh * | asDoubleString (int significantDigits, const StaticContext *context) const |
|
Reimplemented from AnyAtomicType. Reimplemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
|
|
Returns a Numeric object which is the sum of this and other.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
|
|
|
|
|
|
|
|
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
|
|
Returns the ceiling of this Numeric.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
|
|
|
|
Returns less than 0 if this is less that other, 0 if they are the same, and greater than 0 otherwise.
|
|
Returns a Numeric object which is the quotient of this and other.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. |
|
Returns the floor of this Numeric.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implements AnyAtomicType. Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Returns true if this is greater than other, false otherwise.
|
|
Returns the Additive inverse of this Numeric.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Is this Numeric negative?
Implemented in ATDecimalOrDerived, and ATFloatOrDerived. |
|
Reimplemented from AnyAtomicType. |
|
Is this Numeric positive?
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Does this Numeric have value 0?
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Returns true if this is less than other, false otherwise.
|
|
Returns the arithmetic product of its operands as a Numeric.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Returns a Numeric object which is the product of this and other.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Rounds this Numeric.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Rounds this Numeric to the given precision, and rounds a half to even.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
Returns a Numeric object which is the difference of this and other.
Implemented in ATDecimalOrDerived, ATDoubleOrDerived, and ATFloatOrDerived. |
|
|
|
|
|
|
|
|
|
|
|
|