Qt 4.8
|
Base template class for Float and Double classes. More...
#include <qabstractfloat_p.h>
Public Functions | |
virtual Numeric::Ptr | abs () const |
virtual Numeric::Ptr | ceiling () const |
bool | evaluateEBV (const QExplicitlySharedDataPointer< DynamicContext > &) const |
virtual Numeric::Ptr | floor () const |
virtual bool | isInf () const |
virtual bool | isNaN () const |
virtual bool | isSigned () const |
Returns true if this value is signed. If false is returned, the value is unsigned. More... | |
virtual Numeric::Ptr | round () const |
virtual Numeric::Ptr | roundHalfToEven (const xsInteger scale) const |
virtual QString | stringValue () const |
virtual xsDecimal | toDecimal () const |
virtual xsDouble | toDouble () const |
virtual xsFloat | toFloat () const |
virtual xsInteger | toInteger () const |
virtual Item | toNegated () const |
virtual qulonglong | toUnsignedInteger () const |
virtual ItemType::Ptr | type () const |
Public Functions inherited from QPatternist::AtomicValue | |
virtual bool | hasError () const |
virtual | ~AtomicValue () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Public Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
const TCastTarget * | as () const |
TCastTarget * | as () |
Static Public Functions | |
static AtomicValue::Ptr | fromLexical (const QString &strNumeric) |
static Numeric::Ptr | fromValue (const xsDouble num) |
static bool | isEqual (const xsDouble a, const xsDouble b) |
Static Public Functions inherited from QPatternist::Numeric | |
static AtomicValue::Ptr | fromLexical (const QString &number) |
Static Public Functions inherited from QPatternist::AtomicValue | |
static ItemType::Ptr | qtToXDMType (const QXmlItem &item) |
static QVariant | toQt (const AtomicValue *const value) |
static QVariant | toQt (const AtomicValue::Ptr &value) |
static Item | toXDM (const QVariant &value) |
Protected Functions | |
AbstractFloat (const xsDouble num) | |
Protected Functions inherited from QPatternist::AtomicValue | |
AtomicValue () | |
Protected Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
CppCastingHelper () | |
Private Functions | |
bool | isZero () const |
Static Private Functions | |
static int | internalSignbit (const xsDouble v) |
Properties | |
const xsDouble | m_value |
Additional Inherited Members | |
Public Types inherited from QPatternist::Numeric | |
typedef QExplicitlySharedDataPointer< Numeric > | Ptr |
Public Types inherited from QPatternist::AtomicValue | |
typedef QList< AtomicValue::Ptr > | List |
typedef QExplicitlySharedDataPointer< AtomicValue > | Ptr |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Static Protected Functions inherited from QPatternist::Numeric | |
static xsDouble | roundFloat (const xsDouble val) |
Implements fn:round() for types implemented with floating point. More... | |
Base template class for Float and Double classes.
Definition at line 78 of file qabstractfloat_p.h.
|
protected |
Definition at line 49 of file qabstractfloat.cpp.
|
virtual |
Performs the algorithm specified for the function fn:abs on this Numeric, and whose result is returned.
Implements QPatternist::Numeric.
Definition at line 275 of file qabstractfloat.cpp.
|
virtual |
Performs the algorithm specified for the function fn:ceiling on this Numeric, and whose result is returned.
Implements QPatternist::Numeric.
Definition at line 269 of file qabstractfloat.cpp.
|
virtual |
Determines the Effective Boolean Value of this number.
false
if the number is 0 or NaN
, otherwise true
. Reimplemented from QPatternist::AtomicValue.
Definition at line 136 of file qabstractfloat.cpp.
|
virtual |
Performs the algorithm specified for the function fn:floor on this Numeric, and whose result is returned.
Implements QPatternist::Numeric.
Definition at line 263 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::roundHalfToEven().
|
static |
Definition at line 60 of file qabstractfloat.cpp.
|
static |
Definition at line 54 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::abs(), QPatternist::AbstractFloat< isDouble >::ceiling(), QPatternist::XsdTypeChecker::checkConstrainingFacetsDouble(), QPatternist::SubstringFN::evaluateSingleton(), QPatternist::AbstractFloat< isDouble >::floor(), QPatternist::AbstractFloat< isDouble >::round(), QPatternist::AbstractFloat< isDouble >::roundHalfToEven(), QPatternist::AbstractFloat< isDouble >::toNegated(), and QPatternist::AtomicValue::toXDM().
|
inlinestaticprivate |
From the Open Group's man page: "The signbit() macro shall return a non-zero value if and only if the sign of its argument value is negative."
MS Windows doesn't have std::signbit() so here's a reinvention of that function.
Definition at line 91 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::isEqual(), and QPatternist::AbstractFloat< isDouble >::stringValue().
|
static |
Performs floating point comparison.
true
if a
and are
equal, otherwise false
. Definition at line 113 of file qabstractfloat.cpp.
Referenced by QPatternist::DurationNumericMathematician::calculate(), QPatternist::NumericToBooleanCaster::castFrom(), QPatternist::AbstractFloatComparator::compare(), QPatternist::AbstractFloatSortComparator< t_op >::compare(), QPatternist::DecimalComparator::compare(), QPatternist::AbstractFloatComparator::equals(), QPatternist::DecimalComparator::equals(), QPatternist::Decimal::evaluateEBV(), QPatternist::AbstractFloat< isDouble >::isZero(), QPatternist::GenericPredicate::mapToItem(), and QPatternist::Decimal::toString().
|
virtual |
Determines whether this Numeric is an infinite number. Signedness is irrelevant, -INF as well as INF is considered infinity.
For numeric types that cannot represent infinity, such as xs:integer , this function should return false
.
true
if this Numeric is an infinite number Implements QPatternist::Numeric.
Definition at line 289 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::roundHalfToEven().
|
virtual |
Determines whether this Numeric is not-a-number, NaN
. For numeric types that cannot represent NaN
, this function should return false
.
true
if this Numeric is NaN
Implements QPatternist::Numeric.
Definition at line 283 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::roundHalfToEven().
|
virtual |
Returns true
if this value is signed. If false
is returned, the value is unsigned.
For float and decimal values, xs:double
, xs:float
and xs:decimal
, the code asserts and behavior is undefined.
Implements QPatternist::Numeric.
Definition at line 307 of file qabstractfloat.cpp.
|
inlineprivate |
Definition at line 130 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::evaluateEBV(), QPatternist::AbstractFloat< isDouble >::roundHalfToEven(), and QPatternist::AbstractFloat< isDouble >::stringValue().
|
virtual |
Performs the algorithm specified for the function fn:round on this Numeric, and whose result is returned.
Implements QPatternist::Numeric.
Definition at line 230 of file qabstractfloat.cpp.
|
virtual |
Performs rounding as defined for the fn:round-half-to-even on this Numeric, and whose result is returned.
Implements QPatternist::Numeric.
Definition at line 236 of file qabstractfloat.cpp.
|
virtual |
Returns this AbstractFloat represented as an xs:string
.
xs:double
and xs:float
to xs:string
is not specified in XML Schema 1.0 Part 2: Datatypes Second Edition, but in XQuery 1.0 and XPath 2.0 Functions and Operators. This will change with W3C XML Schema 1.1Implements QPatternist::AtomicValue.
Definition at line 145 of file qabstractfloat.cpp.
|
virtual |
Implements QPatternist::Numeric.
Definition at line 224 of file qabstractfloat.cpp.
Referenced by QPatternist::AbstractFloat< isDouble >::stringValue().
|
virtual |
Implements QPatternist::Numeric.
Definition at line 205 of file qabstractfloat.cpp.
|
virtual |
Implements QPatternist::Numeric.
Definition at line 217 of file qabstractfloat.cpp.
|
virtual |
Implements QPatternist::Numeric.
Definition at line 211 of file qabstractfloat.cpp.
|
virtual |
Unary minus.
Implements QPatternist::Numeric.
Definition at line 301 of file qabstractfloat.cpp.
|
virtual |
Implements QPatternist::Numeric.
Definition at line 315 of file qabstractfloat.cpp.
|
virtual |
Implements QPatternist::AtomicValue.
Definition at line 295 of file qabstractfloat.cpp.
|
private |
Definition at line 147 of file qabstractfloat_p.h.
Referenced by QPatternist::AbstractFloat< isDouble >::abs(), QPatternist::AbstractFloat< isDouble >::ceiling(), QPatternist::AbstractFloat< isDouble >::evaluateEBV(), QPatternist::AbstractFloat< isDouble >::floor(), QPatternist::AbstractFloat< isDouble >::isInf(), QPatternist::AbstractFloat< isDouble >::isNaN(), QPatternist::AbstractFloat< isDouble >::isZero(), QPatternist::AbstractFloat< isDouble >::round(), QPatternist::AbstractFloat< isDouble >::roundHalfToEven(), QPatternist::AbstractFloat< isDouble >::stringValue(), QPatternist::AbstractFloat< isDouble >::toDecimal(), QPatternist::AbstractFloat< isDouble >::toDouble(), QPatternist::AbstractFloat< isDouble >::toFloat(), QPatternist::AbstractFloat< isDouble >::toInteger(), and QPatternist::AbstractFloat< isDouble >::toNegated().