48 template <const
bool isDouble>
53 template <const
bool isDouble>
59 template <const
bool isDouble>
81 bool conversionOk =
false;
90 template <const
bool isDouble>
94 "This implementation of signbit assumes xsDouble, that is qreal, is 64 bits large.");
102 value.asDouble = num;
107 return value.asInt >> 63;
109 return value.asInt >> 31;
112 template <const
bool isDouble>
125 return qAbs(a - b) <= 2.2204460492503131e-16 *
qAbs(a);
129 template <const
bool isDouble>
135 template <const
bool isDouble>
144 template <const
bool isDouble>
174 static_cast<void>(
qdtoa(
m_value, -1, 0, &decimalPoint, &sign, 0, &result));
189 valueAsString += qret.
at(0);
195 valueAsString += qret.
mid(1);
200 return valueAsString;
204 template <const
bool isDouble>
210 template <const
bool isDouble>
216 template <const
bool isDouble>
223 template <const
bool isDouble>
229 template <const
bool isDouble>
235 template <const
bool isDouble>
243 const xsDouble powered = pow(
double(10),
double(precision));
247 if(val - 0.5 == ::
floor(val))
250 val = m_value * powered + 0.5;
262 template <const
bool isDouble>
268 template <const
bool isDouble>
274 template <const
bool isDouble>
282 template <const
bool isDouble>
288 template <const
bool isDouble>
294 template <const
bool isDouble>
300 template <const
bool isDouble>
306 template <const
bool isDouble>
310 "It makes no sense to call this function, see Numeric::isSigned().");
314 template <const
bool isDouble>
318 "It makes no sense to call this function, see Numeric::toUnsignedInteger().");
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Base template class for Float and Double classes.
virtual xsDecimal toDecimal() const
QExplicitlySharedDataPointer< AtomicValue > Ptr
const QChar at(int i) const
Returns the character at the given index position in the string.
virtual Item toNegated() const
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
static AtomicValue::Ptr createError(const QString &description=QString(), const ReportContext::ErrorCode=ReportContext::FORG0001)
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
static const AtomicValue::Ptr DoubleNaN
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
virtual bool isSigned() const
Returns true if this value is signed. If false is returned, the value is unsigned.
long ASN1_INTEGER_get ASN1_INTEGER * a
virtual Numeric::Ptr round() const
virtual xsFloat toFloat() const
static const AtomicValue::Ptr FloatNaN
The QString class provides a Unicode character string.
Q_DECL_CONSTEXPR T qAbs(const T &t)
virtual Numeric::Ptr roundHalfToEven(const xsInteger scale) const
static const AtomicValue::Ptr NegativeInfFloat
static int internalSignbit(const xsDouble v)
T * data() const
Returns a pointer to the shared data object.
virtual Numeric::Ptr floor() const
int size() const
Returns the number of characters in this string.
static AtomicValue::Ptr fromLexical(const QString &strNumeric)
virtual bool isInf() const
virtual qulonglong toUnsignedInteger() const
static const AtomicType::Ptr xsDouble
bool evaluateEBV(const QExplicitlySharedDataPointer< DynamicContext > &) const
virtual bool isNaN() const
virtual QString stringValue() const
Q_CORE_EXPORT bool qIsNaN(double d)
Returns true if the double {d} is not a number (NaN).
virtual xsDouble toDouble() const
static const AtomicValue::Ptr InfFloat
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
#define Q_ASSERT_X(cond, where, what)
Represents an item in the XPath 2.0 Data Model.
static bool isEqual(const xsDouble a, const xsDouble b)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
virtual ItemType::Ptr type() const
static const AtomicType::Ptr xsFloat
virtual xsInteger toInteger() const
double toDouble(bool *ok=0) const
Returns the string converted to a double value.
static Numeric::Ptr fromValue(const xsDouble num)
static const AtomicValue::Ptr InfDouble
virtual Numeric::Ptr ceiling() const
static xsDouble roundFloat(const xsDouble val)
Implements fn:round() for types implemented with floating point.
static const AtomicValue::Ptr NegativeInfDouble
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
virtual Numeric::Ptr abs() const
Q_CORE_EXPORT bool qIsInf(double d)
Returns true if the double {d} is equivalent to infinity.
QExplicitlySharedDataPointer< Numeric > Ptr
static QString toString(const xsDecimal value)