![]() |
Qt 6.x
The Qt SDK
|
#include <QtCore/qtconfigmacros.h>
#include <QtCore/qtcoreexports.h>
#include <QtCore/qtypes.h>
#include <cmath>
#include <limits>
#include <type_traits>
Go to the source code of this file.
Namespaces | |
namespace | QtPrivate |
\macro QT_NAMESPACE | |
Macros | |
#define | Q_INFINITY (QT_PREPEND_NAMESPACE(qInf)()) |
#define | Q_QNAN (QT_PREPEND_NAMESPACE(qQNaN)()) |
Functions | |
template<typename T > | |
QT_BEGIN_NAMESPACE constexpr std::enable_if< std::is_integral< T >::value, bool >::type | qIsInf (T) |
template<typename T > | |
constexpr std::enable_if< std::is_integral< T >::value, bool >::type | qIsNaN (T) |
template<typename T > | |
constexpr std::enable_if< std::is_integral< T >::value, bool >::type | qIsFinite (T) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsInf (double d) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsNaN (double d) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsFinite (double d) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int | qFpClassify (double val) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsInf (float f) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsNaN (float f) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool | qIsFinite (float f) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int | qFpClassify (float val) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double | qQNaN () |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double | qInf () |
Q_CORE_EXPORT quint32 | qFloatDistance (float a, float b) |
Q_CORE_EXPORT quint64 | qFloatDistance (double a, double b) |
template<typename T > | |
std::enable_if_t< std::is_unsigned_v< T >, bool > | qAddOverflow (T v1, T v2, T *r) |
template<typename T > | |
std::enable_if_t< std::is_signed_v< T >, bool > | qAddOverflow (T v1, T v2, T *r) |
template<typename T > | |
std::enable_if_t< std::is_unsigned_v< T >, bool > | qSubOverflow (T v1, T v2, T *r) |
template<typename T > | |
std::enable_if_t< std::is_signed_v< T >, bool > | qSubOverflow (T v1, T v2, T *r) |
template<typename T > | |
std::enable_if_t< std::is_unsigned_v< T >||std::is_signed_v< T >, bool > | qMulOverflow (T v1, T v2, T *r) |
template<typename T , T V2> | |
bool | qAddOverflow (T v1, std::integral_constant< T, V2 >, T *r) |
template<auto V2, typename T > | |
bool | qAddOverflow (T v1, T *r) |
template<typename T , T V2> | |
bool | qSubOverflow (T v1, std::integral_constant< T, V2 >, T *r) |
template<auto V2, typename T > | |
bool | qSubOverflow (T v1, T *r) |
template<typename T , T V2> | |
bool | qMulOverflow (T v1, std::integral_constant< T, V2 >, T *r) |
template<auto V2, typename T > | |
bool | qMulOverflow (T v1, T *r) |
template<typename T > | |
constexpr T | qAbs (const T &t) |
constexpr int | qRound (double d) |
constexpr int | qRound (float d) |
constexpr qint64 | qRound64 (double d) |
constexpr qint64 | qRound64 (float d) |
template<typename T > | |
constexpr const T & | QtPrivate::min (const T &a, const T &b) |
constexpr bool | qFuzzyCompare (double p1, double p2) |
constexpr bool | qFuzzyCompare (float p1, float p2) |
constexpr bool | qFuzzyIsNull (double d) |
constexpr bool | qFuzzyIsNull (float f) |
QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE constexpr bool | qIsNull (double d) noexcept |
constexpr bool | qIsNull (float f) noexcept |
QT_WARNING_POP int | qIntCast (double f) |
int | qIntCast (float f) |
#define Q_INFINITY (QT_PREPEND_NAMESPACE(qInf)()) |
Definition at line 77 of file qnumeric.h.
#define Q_QNAN (QT_PREPEND_NAMESPACE(qQNaN)()) |
Definition at line 81 of file qnumeric.h.
|
inlineconstexpr |
Definition at line 328 of file qnumeric.h.
Referenced by QQuickSelectionRectanglePrivate::QQuickSelectionRectanglePrivate(), QtPrivate::QMovableArrayOps< T >::Inserter::~Inserter(), QGraphicsSceneBspTreeIndexPrivate::_q_updateIndex(), QtPrivate::QHypotHelper< T >::add(), QBezier::addToPolygon(), QBezier::addToPolygon(), QQuick3DParticleScaleAffector::affectParticle(), QQuickWanderAffector::affectParticle(), QAndroidCameraSession::applyResolution(), QQuickContext2D::arc(), avfVideoSettings(), QSSGBounds3::basisExtent(), bestSizeScaleMatch(), bestStyle(), QWaylandInputMethodEventBuilder::buildCommit(), QV4DataCollector::buildFrame(), QQuickPathViewPrivate::calcCurrentIndex(), QSpinBoxPrivate::calculateAdaptiveDecimalStep(), QDoubleSpinBoxPrivate::calculateAdaptiveDecimalStep(), calculateVideoFrameStride(), QuickTestUtil::callerLine(), QV4::ExecutionEngine::catchExceptionAsQmlError(), QGeoTiledMapPrivate::changeCameraData(), QQuickDeliveryAgentPrivate::checkIfDoubleTapped(), QWidgetWindowPrivate::closestAcceptableGeometry(), QListViewPrivate::closestIndex(), QQuickVisualTestUtils::compareImages(), computeBBox(), QFreetypeFace::computeSize(), QSSGPlane::contains(), convertPath(), convertWeights(), QWebMercator::coordinateInterpolation(), copyImageData(), createPixmapCursorFromData(), QQuickSwipePrivate::createRelevantItemForDistance(), QScrollerPrivate::createScrollingSegments(), QV4DebuggerAgent::debuggerPaused(), QCoreGraphicsPaintEnginePrivate::devicePixelSize(), directorySizeDistance(), do_write_jpeg_image(), QLocaleData::doubleToString(), QQuickDeliveryAgentPrivate::dragOverThreshold(), QQuickPointerHandlerPrivate::dragOverThreshold(), QQuickDeliveryAgentPrivate::dragOverThreshold(), QQuickDeliveryAgentPrivate::dragOverThreshold(), QQuickPointerHandlerPrivate::dragOverThreshold(), QPainterPrivate::draw_helper(), QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(), QRasterPaintEngine::drawImage(), drawLine(), drawLineAA(), QWin32PrintEngine::drawPixmap(), QRasterPaintEngine::drawTiledPixmap(), dtoString(), epsilonCompare(), QJSEngine::evaluate(), QGeoRectanglePrivate::extendRectangle(), FDot16FixedDiv(), fetchTransformedBilinear(), fetchTransformedBilinear_simple_scale_helper(), fetchTransformedBilinearARGB32PM(), fetchTransformedBilinearARGB32PM_simple_scale_helper(), QRasterPlatformPixmap::fill(), QQuickSwipePrivate::finishTransition(), QQuickFlickablePrivate::fixup(), QQuickGridViewPrivate::fixup(), QQuickListViewPrivate::fixup(), QQuickFlickablePrivate::flick(), QQuickGridViewPrivate::flick(), QQuickListViewPrivate::flick(), QBackingStore::flush(), QLocale::formattedDataSize(), QWindowsGeometryHint::frame(), QWindowsGeometryHint::frameOnPrimaryScreen(), QVideoFrameFormatPrivate::frameRatesEqual(), QOCIDateTime::fromOCIDateTime(), QuickTestResult::fuzzyCompare(), QQuickMatrix4x4ValueType::fuzzyEquals(), QQuickQuaternionValueType::fuzzyEquals(), QQuickVector2DValueType::fuzzyEquals(), QQuickVector3DValueType::fuzzyEquals(), QQuickVector4DValueType::fuzzyEquals(), fuzzyIsNull(), QPdfDocument::getSelection(), good_offset(), QQuickDrawerPrivate::grabMouse(), QScrollerPrivate::handleDrag(), QQuickPathViewPrivate::handleMouseMoveEvent(), QQuickPathViewPrivate::handleMousePressEvent(), QQuickPathViewPrivate::handleMouseReleaseEvent(), QQuickDragHandler::handlePointerEventImpl(), QQuickPinchHandler::handlePointerEventImpl(), QQuickRangeSliderPrivate::handlePress(), QQuickFlickablePrivate::handlePressEvent(), QQuickFlickablePrivate::handleReleaseEvent(), QPdfDocumentPrivate::hitTest(), QColorSpacePrivate::identifyColorSpace(), imageFromWinHBITMAP_GetDiBits(), QCoreTextFontEngine::init(), QWaylandQtTextInputMethod::inputMethodQuery(), QWaylandTextInputPrivate::inputMethodQuery(), QWaylandTextInputV4Private::inputMethodQuery(), QSSGClipPlane::intersectWithLine(), QQuickDialPrivate::isLargeChange(), QIntersectionPoint::isOnLine(), QQuickContext2D::isPointInPath(), quant::isSane(), QSimplexConstraint::isSatisfied(), quant::isUnit(), QStroker::joinPoints(), jsStack(), QTextDocumentLayoutPrivate::layoutFlow(), QWindowsFontDatabaseBase::LOGFONT_to_QFont(), QPoint::manhattanLength(), QPointF::manhattanLength(), QDoubleVector2D::manhattanLength(), QScanConverter::mergeCurve(), QV4::DatePrototype::method_toISOString(), QFontEngine::minRightBearing(), QHeaderView::mouseMoveEvent(), QQuickPressHandler::mouseMoveEvent(), QQuickTextInput::mouseMoveEvent(), QTabBar::mouseReleaseEvent(), QAbstractButtonPrivate::moveFocus(), QToolBarAreaLayoutInfo::moveToolBar(), QScrollerPrivate::moveWhilePressed(), QScrollerPrivate::nextSnapPos(), operator<<(), QTextEditPrivate::pageUpDown(), QGraphicsEllipseItem::paint(), QQuickSvgParser::pathArc(), pathArc(), QTriangulator< T >::polyline(), QMenuSloppyState::processMouseEvent(), QGuiApplicationPrivate::processMouseEvent(), q_coordinateShortestInterpolator(), Q_LOGGING_CATEGORY(), qFuzzyCompare(), qFuzzyCompare(), qFuzzyCompare(), qFuzzyIsNull(), qFuzzyIsNull(), qFuzzyIsNull(), QImageScale::qimageCalcScaleInfo(), QImageScale::qimageCalcXPoints(), QImageScale::qimageCalcYPoints(), qRealToFraction(), qt_create_image_data(), qt_device_format_pixel_aspect_ratio(), qt_find_best_framerate_match(), qt_find_best_resolution_match(), qt_find_supported_framerate_range(), qt_scaleForTransform(), qt_scrollRectInImage(), QCoreTextFontEngine::qtWeightFromCFWeight(), QRasterizer::rasterizeLine(), read_dib_infoheader(), QSwipeGestureRecognizer::recognize(), QIBaseResult::record(), QIBaseDriver::record(), AndroidPositioning::registerPositionInfoSource(), QtConcurrent::ThreadEngineBarrier::release(), QtConcurrent::ThreadEngineBarrier::releaseUnlessLast(), QProgressBarPrivate::repaintRequired(), replaceArgEscapes(), QWindowsTabletDeviceData::scaleCoordinates(), QTreeView::scrollContentsBy(), QQuickTableViewPrivate::scrollToColumn(), QQuickTableViewPrivate::scrollToRow(), QTreeViewPrivate::select(), QWidgetTextControl::selectAll(), QQuickTextControl::selectAll(), Utils::TextCursor::selectedText(), QWaylandTextInputPrivate::sendInputMethodEvent(), QSimplex::setConstraints(), QQuickTextPrivate::setLineGeometry(), QQuickDialPrivate::setPosition(), QMacPrintEngine::setProperty(), QAbstractSliderPrivate::setSteps(), setupCameraForShadowMap(), QSpanData::setupMatrix(), QPen::setWidthF(), QPaintEngineEx::shouldDrawCachedGlyphs(), QQuickPathViewPrivate::snapToIndex(), QBezier::tAtLength(), QDoubleSpinBox::textFromValue(), QSpinBox::textFromValue(), QtAndroidAccessibility::textFromValue(), QBezier::tForY(), toOffsetString(), QGeoCoordinate::toString(), QX11PlatformPixmap::transformed(), QQuickSpringAnimation::transition(), QTriangulator< T >::triangulate(), QLineF::unitVector(), updateBBox(), QSpringAnimation::updateCurrentTime(), QQuickBoundaryReturnJob::updateCurrentTime(), QSGBasicInternalImageNode::updateGeometry(), QSGBasicInternalImageNode::updateGeometry(), QOpenGL2PaintEngineExPrivate::updateMatrix(), QRasterPaintEnginePrivate::updateMatrixData(), QQuickSpringAnimationPrivate::updateMode(), QQuickRectangle::updatePaintNode(), QQuickShaderEffectSource::updatePaintNode(), QSpatialSoundPrivate::updateRoomEffects(), QAudioEnginePrivate::updateRooms(), QQuick3DTexture::updateSpatialNode(), QtWaylandClient::QWaylandTextInputv1::updateState(), QtWaylandClient::QWaylandTextInputv2::updateState(), QQuickMultiPointTouchArea::updateTouchData(), QT_BEGIN_NAMESPACE::QQuickShapeCurveMaterialShader::updateUniformData(), QQuickShapeStrokeMaterialShader::updateUniformData(), QSGDistanceFieldTextMaterialRhiShader::updateUniformData(), v4StackTrace(), QIntValidator::validate(), QDoubleValidatorPrivate::validateWithLocale(), AVFMediaPlayer::videoOrientationForAssetTrack(), QQuickFlickablePrivate::viewportAxisMoved(), QGeoProjectionWebMercator::visibleRegion(), QQuickFlickable::xflick(), QTextLine::xToCursor(), and QQuickFlickable::yflick().
template< typename T, T V2 > bool qAddOverflow | ( | T | v1, |
std::integral_constant< T, V2 > | , | ||
T * | r | ||
) |
Equivalent to qAddOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument.
Definition at line 253 of file qnumeric.h.
References qAddOverflow().
template< auto V2, typename T > bool qAddOverflow | ( | T | v1, |
T * | r | ||
) |
Equivalent to qAddOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument.
Definition at line 258 of file qnumeric.h.
References qAddOverflow().
|
inline |
Definition at line 113 of file qnumeric.h.
Referenced by QV4::add_int32(), add_saturate(), QDate::addDays(), QDateTime::addMSecs(), QImageData::calculateImageParameters(), QTimeZonePrivate::dataForLocalTime(), daysAndMillisOverflow(), QDateTimePrivate::expressUtcAsLocal(), findSectionTable(), findStringTable(), Generator::generateCode(), QDateTimePrivate::localStateAtMillis(), qAddOverflow(), qAddOverflow(), qCalculateBlockSize(), qMulOverflow(), QCborStreamReaderPrivate::readStringChunk_byte(), reserveExtraBytes(), QDateTime::setMSecsSinceEpoch(), and QV4::stringToArrayIndex().
|
inline |
Definition at line 121 of file qnumeric.h.
References s2.
Q_CORE_EXPORT quint64 qFloatDistance | ( | double | a, |
double | b | ||
) |
Q_CORE_EXPORT quint32 qFloatDistance | ( | float | a, |
float | b | ||
) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int qFpClassify | ( | double | val | ) |
Definition at line 98 of file qnumeric.cpp.
References qt_fpclassify().
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int qFpClassify | ( | float | val | ) |
Definition at line 99 of file qnumeric.cpp.
References qt_fpclassify().
|
constexpr |
Definition at line 369 of file qnumeric.h.
References QtPrivate::min(), p1, p2, and qAbs().
|
constexpr |
Definition at line 374 of file qnumeric.h.
References QtPrivate::min(), p1, p2, and qAbs().
|
constexpr |
|
constexpr |
Definition at line 384 of file qnumeric.h.
References qAbs().
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qInf | ( | ) |
Referenced by QDeclarativeGeoMapItemUtils::boundingRectangleFromList(), QDeclarativeGeoMapItemUtils::clipPolygon(), computeBBox(), QPSQLResult::data(), QQuickDeliveryAgentPrivate::deliverTouchAsMouse(), QDeclarativeGeoMapItemUtils::distanceSqrPointLine(), QTextStreamPrivate::getReal(), QV4::NumberPrototype::init(), QQuickPageIndicatorPrivate::itemAt(), QV4::Compiler::Codegen::Reference::loadInAccumulator(), QV4::StringPrototype::method_lastIndexOf(), QV4::StringPrototype::method_substr(), QBasicDrag::startDrag(), updateBBox(), QAudioEnginePrivate::updateRooms(), and writeDouble().
|
inline |
Definition at line 404 of file qnumeric.h.
|
inline |
Definition at line 405 of file qnumeric.h.
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsFinite | ( | double | d | ) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsFinite | ( | float | f | ) |
|
constexpr |
Definition at line 56 of file qnumeric.h.
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsInf | ( | double | d | ) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsInf | ( | float | f | ) |
|
constexpr |
Definition at line 50 of file qnumeric.h.
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsNaN | ( | double | d | ) |
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsNaN | ( | float | f | ) |
|
constexpr |
Definition at line 53 of file qnumeric.h.
|
constexprnoexcept |
Definition at line 392 of file qnumeric.h.
References d.
|
constexprnoexcept |
Definition at line 397 of file qnumeric.h.
template< typename T, T V2 > bool qMulOverflow | ( | T | v1, |
std::integral_constant< T, V2 > | , | ||
T * | r | ||
) |
Equivalent to qMulOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument. This can be faster than calling the version with only variable arguments.
Definition at line 273 of file qnumeric.h.
References qMulOverflow(), and v1.
template< auto V2, typename T > bool qMulOverflow | ( | T | v1, |
T * | r | ||
) |
Equivalent to qMulOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument. This can be faster than calling the version with only variable arguments.
Definition at line 320 of file qnumeric.h.
References qAddOverflow(), and qMulOverflow().
|
inline |
Definition at line 182 of file qnumeric.h.
Referenced by QDateTime::addSecs(), QImageData::calculateImageParameters(), convertToExtendedType(), daysAndMillisOverflow(), QDateTimePrivate::expressUtcAsLocal(), QV4::mul_int32(), qCalculateBlockSize(), qMulOverflow(), qMulOverflow(), QAstcHandler::read(), QDateTime::setSecsSinceEpoch(), QV4::stringToArrayIndex(), and QV4::TypedArrayCtor::virtualCallAsConstructor().
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qQNaN | ( | ) |
Referenced by QGeoPositionInfo::attribute(), QGeoProjectionWebMercator::coordinateToItemPosition(), QPSQLResult::data(), QGeoProjectionWebMercator::fitViewportToGeoRectangle(), QDeclarativeGeoMap::fromCoordinate(), QTextStreamPrivate::getReal(), QGeoRectangle::height(), QV4::Compiler::Codegen::Reference::loadInAccumulator(), MakeDay(), MakeTime(), QV4::DatePrototype::method_UTC(), QV4::RuntimeHelpers::stringToNumber(), QGeoRectangle::width(), and writeDouble().
|
inlineconstexpr |
Definition at line 353 of file qnumeric.h.
References d.
|
inlineconstexpr |
Definition at line 355 of file qnumeric.h.
References d.
|
inlineconstexpr |
Definition at line 358 of file qnumeric.h.
References d.
|
inlineconstexpr |
Definition at line 360 of file qnumeric.h.
References d.
template< typename T, T V2 > bool qSubOverflow | ( | T | v1, |
std::integral_constant< T, V2 > | , | ||
T * | r | ||
) |
Equivalent to qSubOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument.
Definition at line 263 of file qnumeric.h.
References qSubOverflow().
template< auto V2, typename T > bool qSubOverflow | ( | T | v1, |
T * | r | ||
) |
Equivalent to qSubOverflow(v1, v2, r) with v1 as first argument, the compile time constant V2
as second argument, and r as third argument.
Definition at line 268 of file qnumeric.h.
References qSubOverflow().
|
inline |
Definition at line 153 of file qnumeric.h.
Referenced by QTimeZonePrivate::dataForLocalTime(), QDateTimePrivate::expressUtcAsLocal(), qSubOverflow(), qSubOverflow(), and QV4::sub_int32().
|
inline |
Definition at line 161 of file qnumeric.h.
References s2.