7#include <QtCore/qnumeric.h>
8#include <QtCore/qmath.h>
9#include <QtCore/QDebug>
27 defaultDoublePrecision(0xffffff80)
36 return numberLocaleHolder();
46 auto v4 =
f->engine();
47 double dbl = argc ? argv[0].
toNumber() : 0.;
54 obj->setProtoFromNewTarget(newTarget);
55 return obj->asReturnedValue();
60 double dbl = argc ? argv[0].
toNumber() : 0.;
90 defineDefaultProperty(
engine->id_toString(), method_toString, 1);
91 defineDefaultProperty(
engine->id_toLocaleString(), method_toLocaleString);
92 defineDefaultProperty(
engine->id_valueOf(), method_valueOf);
93 defineDefaultProperty(
QStringLiteral(
"toFixed"), method_toFixed, 1);
94 defineDefaultProperty(
QStringLiteral(
"toExponential"), method_toExponential, 1);
95 defineDefaultProperty(
QStringLiteral(
"toPrecision"), method_toPrecision, 1);
140 double dv =
v.toNumber();
144 double iv =
v.toInteger();
157 double dv =
v.toNumber();
161 double iv =
v.toInteger();
162 return Encode(dv == iv && std::fabs(iv) <= (1LL << 53) - 1);
173 return Encode(
bool(std::isnan(
v)));
183 if (argc && !argv[0].isUndefined()) {
185 if (radix < 2 || radix > 36) {
221 if (std::isnan(fdigits))
224 if (fdigits < 0 || fdigits > 100)
247 bool defaultDigits = !argc || argv[0].
isUndefined();
258 if (!defaultDigits && (fdigits < 0 || fdigits > 100)) {
274 double d =
v->asDouble();
276 if (!argc || argv[0].isUndefined())
289 if (precision < 1 || precision > 100) {
QString toString(qlonglong i) const
Returns a localized string representation of i.
@ IncludeTrailingZeroesAfterDot
@ OmitLeadingZeroInExponent
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static const NumberLocale * instance()
const int defaultDoublePrecision
\qmltype Particle \inqmlmodule QtQuick.Particles
static QString toString(QV4::ReturnedValue v)
#define QT_WARNING_DISABLE_INTEL(number)
DBusConnection const char DBusError * error
bool qIsInf(qfloat16 f) noexcept
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static bool isNumber(char s)
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qInf()
constexpr static Q_DECL_CONST_FUNCTION double qt_qnan() noexcept
static Q_DECL_CONST_FUNCTION bool qt_is_inf(double d)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLenum GLint GLint * precision
#define QStringLiteral(str)
double thisNumber(ExecutionEngine *engine, const Value *thisObject)
ReturnedValue thisNumberValue(ExecutionEngine *v4, const Value *thisObject)
#define DEFINE_OBJECT_VTABLE(classname)
static constexpr ReturnedValue undefined()
Heap::String * newString(const QString &s=QString())
ReturnedValue throwRangeError(const Value &value)
ReturnedValue throwError(const Value &value)
ReturnedValue throwTypeError()
Heap::ExecutionContext * scope() const
void init(QV4::ExecutionContext *scope)
static ReturnedValue method_toLocaleString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isNaN(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toFixed(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isSafeInteger(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toPrecision(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isFinite(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void init(ExecutionEngine *engine, Object *ctor)
static ReturnedValue method_toExponential(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_valueOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
static ReturnedValue method_isInteger(const FunctionObject *, const Value *thisObject, const Value *argv, int argc)
void defineDefaultProperty(StringOrSymbol *name, const Value &value, PropertyAttributes attributes=Attr_Data|Attr_NotEnumerable)
void defineReadonlyConfigurableProperty(const QString &name, const Value &value)
void defineReadonlyProperty(const QString &name, const Value &value)
static void numberToString(QString *result, double num, int radix=10)
static Heap::String * stringFromNumber(ExecutionEngine *engine, double number)
bool hasException() const
constexpr ReturnedValue asReturnedValue() const
static constexpr VTable::CallAsConstructor virtualCallAsConstructor
static constexpr VTable::Call virtualCall
static constexpr Value fromInt32(int i)
static Value fromDouble(double d)