Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 bool isArrayIndex (double d)
 
static constexpr bool isArrayIndex (qint64 i)
 
static constexpr bool isArrayIndex (quint64 i)
 
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 60 of file qjsnumbercoercion.h.

◆ isArrayIndex() [1/3]

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

Checks whether d contains a value that can serve as an index into an array. For that, d must be a non-negative value representable as an unsigned 32bit int.

Definition at line 28 of file qjsnumbercoercion.h.

◆ isArrayIndex() [2/3]

static constexpr bool QJSNumberCoercion::isArrayIndex ( qint64 i)
inlinestaticconstexpr

Checks whether i contains a value that can serve as an index into an array. For that, d must be a non-negative value representable as an unsigned 32bit int.

Definition at line 36 of file qjsnumbercoercion.h.

◆ isArrayIndex() [3/3]

static constexpr bool QJSNumberCoercion::isArrayIndex ( quint64 i)
inlinestaticconstexpr

Checks whether i contains a value that can serve as an index into an array. For that, d must be a value representable as an unsigned 32bit int.

Definition at line 41 of file qjsnumbercoercion.h.

◆ isInteger()

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

Definition at line 16 of file qjsnumbercoercion.h.

◆ toInteger()

static constexpr int QJSNumberCoercion::toInteger ( double d)
inlinestaticconstexpr

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

Definition at line 46 of file qjsnumbercoercion.h.


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