Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QJSNumberCoercion Class Reference

Implements the JavaScript double-to-int coercion. More...

#include <qjsnumbercoercion.h>

+ Collaboration diagram for QJSNumberCoercion:

Static Public Member Functions

static constexpr bool isInteger (double d)
 
static constexpr int toInteger (double d)
 
static constexpr bool equals (double lhs, double rhs)
 

Detailed Description

Implements the JavaScript double-to-int coercion.

Since
6.1

Definition at line 12 of file qjsnumbercoercion.h.

Member Function Documentation

◆ equals()

static constexpr bool QJSNumberCoercion::equals ( double  lhs,
double  rhs 
)
inlinestaticconstexpr

Definition at line 30 of file qjsnumbercoercion.h.

References QT_WARNING_DISABLE_FLOAT_COMPARE, QT_WARNING_POP, and QT_WARNING_PUSH.

Referenced by isInteger(), QQmlPrivate::jsExponentiate(), QJSPrimitiveValue::strictlyEquals(), QJSPrimitiveValue::toBoolean(), and toInteger().

+ Here is the caller graph for this function:

◆ isInteger()

static constexpr bool QJSNumberCoercion::isInteger ( double  d)
inlinestaticconstexpr

Definition at line 15 of file qjsnumbercoercion.h.

References d, and equals().

+ Here is the call graph for this function:

◆ toInteger()

int QJSNumberCoercion::toInteger ( double  d)
inlinestaticconstexpr

Coerces the given d to a 32bit integer by JavaScript rules and returns the result.

Definition at line 19 of file qjsnumbercoercion.h.

References d, equals(), i, and toInteger().

Referenced by toInteger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: