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.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:insignificant
4
6
8
9/*!
10 \since 6.1
11 \class QJSNumberCoercion
12 \internal
13
14 \brief Implements the JavaScript double-to-int coercion.
15 */
16
17/*!
18 \fn bool QJSNumberCoercion::isInteger(double d)
19 \internal
20 \deprecated 6.7
21 */
22
23/*!
24 \fn bool QJSNumberCoercion::isArrayIndex(double d)
25 \internal
26
27 Checks whether \a d contains a value that can serve as an index into an array.
28 For that, \a d must be a non-negative value representable as an unsigned 32bit int.
29 */
30
31/*!
32 \fn bool QJSNumberCoercion::isArrayIndex(qint64 i)
33 \internal
34
35 Checks whether \a i contains a value that can serve as an index into an array.
36 For that, \a d must be a non-negative value representable as an unsigned 32bit int.
37*/
38
39/*!
40 \fn bool QJSNumberCoercion::isArrayIndex(quint64 i)
41 \internal
42
43 Checks whether \a i contains a value that can serve as an index into an array.
44 For that, \a d must be a value representable as an unsigned 32bit int.
45*/
46
47/*!
48 \fn int QJSNumberCoercion::toInteger(double d)
49 \internal
50
51 Coerces the given \a d to a 32bit integer by JavaScript rules and returns
52 the result.
53 */
54
55/*!
56 \fn bool equals(double lhs, double rhs)
57 \internal
58
59 Compares \a lhs and \a rhs bit by bit without causing a compile warning.
60 Returns the \c true if they are equal, or \c false if not.
61 */
62
63/*!
64 \fn double QJSNumberCoercion::roundTowards0(double d)
65 \internal
66
67 Rounds \a d towards 0 by JavaScript \e ToInteger rules and returns the result.
68*/
69
70QT_END_NAMESPACE
Combined button and popup list for selecting options.