From 17238705b9e94c7eb1b7fafc76a582215e1a0b01 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Fri, 20 Aug 2010 16:44:29 +0200 Subject: Added documentation for qmath.h header and qnumeric.h. Reviewed by: David Boddie Tasks: QTBUG-10011, QTBUG-3205 --- src/corelib/global/qnumeric.cpp | 35 +++++++++ src/corelib/kernel/qmath.qdoc | 155 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 src/corelib/kernel/qmath.qdoc diff --git a/src/corelib/global/qnumeric.cpp b/src/corelib/global/qnumeric.cpp index 75fd31e..7ddb9e2 100644 --- a/src/corelib/global/qnumeric.cpp +++ b/src/corelib/global/qnumeric.cpp @@ -44,14 +44,49 @@ QT_BEGIN_NAMESPACE +/*! + Returns true if the double \a {d} is equivalent to infinity. +*/ Q_CORE_EXPORT bool qIsInf(double d) { return qt_is_inf(d); } + +/*! + Returns true if the double \a {d} is not a number (NaN). +*/ Q_CORE_EXPORT bool qIsNaN(double d) { return qt_is_nan(d); } + +/*! + Returns true if the double \a {d} is a finite number. +*/ Q_CORE_EXPORT bool qIsFinite(double d) { return qt_is_finite(d); } + +/*! + Returns true if the float \a {f} is equivalent to infinity. +*/ Q_CORE_EXPORT bool qIsInf(float f) { return qt_is_inf(f); } + +/*! + Returns true if the float \a {f} is not a number (NaN). +*/ Q_CORE_EXPORT bool qIsNaN(float f) { return qt_is_nan(f); } + +/*! + Returns true if the float \a {f} is a finite number. +*/ Q_CORE_EXPORT bool qIsFinite(float f) { return qt_is_finite(f); } + +/*! + Returns the bit pattern of a signalling NaN as a double. +*/ Q_CORE_EXPORT double qSNaN() { return qt_snan(); } + +/*! + Returns the bit pattern of a quiet NaN as a double. +*/ Q_CORE_EXPORT double qQNaN() { return qt_qnan(); } + +/*! + Returns the bit pattern for an infinite number as a double. +*/ Q_CORE_EXPORT double qInf() { return qt_inf(); } diff --git a/src/corelib/kernel/qmath.qdoc b/src/corelib/kernel/qmath.qdoc new file mode 100644 index 0000000..442fb4d --- /dev/null +++ b/src/corelib/kernel/qmath.qdoc @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in a +** written agreement between you and Nokia. +** +** GNU Free Documentation License +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of this +** file. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \headerfile + \title Math Functions + \ingroup funclists + \brief The header provides various math functions. + \pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm +*/ + +/*! + \fn int qCeil(qreal v) + Return the ceiling of the value \a v. + + The ceiling is the smallest integer that is not less than \a v. + For example, if \a v is 41.2, then the ceiling is 42. + + \relates + \sa qFloor() +*/ + +/*! + \fn int qFloor(qreal v) + Return the floor of the value \a v. + + The floor is the largest integer that is not greater than \a v. + For example, if \a v is 41.2, then the floor is 41. + + \relates + \sa qCeil() +*/ + +/*! + \fn qreal qFabs(qreal v) + Returns the absolute value of \a v as a qreal. +*/ + +/*! + \fn qreal qSin(qreal v) + Returns the sine of the angle \a v in radians. + + \relates + \sa qCos(), qTan() +*/ + +/*! + \fn qreal qCos(qreal v) + Returns the cosine of an angle \a v in radians. + + \relates + \sa qSin(), qTan() +*/ + +/*! + \fn qreal qTan(qreal v) + Returns the tangent of an angle \a v in radians. + + \relates + \sa qSin(), qCos() +*/ + +/*! + \fn qreal qAcos(qreal v) + Returns the arccosine of \a v as an angle in radians. + Arccosine is the inverse operation of cosine. + + \relates + \sa qAtan(), qAsin(), qCos() +*/ + +/*! + \fn qreal qAsin(qreal v) + Returns the arcsine of \a v as an angle in radians. + Arcsine is the inverse operation of sine. + + \relates + \sa qSine(), qAtan(), qAcos() +*/ + +/*! + \fn qreal qAtan(qreal v) + Returns the arctangent of \a v as an angle in radians. + Arctangent is the inverse operation of tangent. + + \relates + \sa qTan(), qAcos(), qAsin() +*/ + +/*! + \fn qreal qAtan2(qreal x, qreal y) + Returns the arctangent of a point specified by the coordinates \a x and \a y. + This function will return the angle and its direction. + + \relates + \sa qAtan() +*/ + +/*! + \fn qreal qSqrt(qreal v) + Returns the square root of \a v. + This function returns a NaN if \a v is a negative number. + + \relates + \sa qPow() +*/ + +/*! + \fn qreal qLn(qreal v) + Returns the natural logarithm of v. Natural logarithm uses base e. + + \relates + \sa qExp() +*/ + +/*! + \fn qreal qExp(qreal v) + Returns the exponential function of \c e to the power of \a v. + + \relates + \sa qLn() +*/ + +/*! + \fn qreal qPow(qreal x, qreal y) + Returns the value of \a x raised to the power of \a y. + That is, \a x is the base and \a y is the exponent. + + \relates + \sa qSqrt() +*/ -- cgit v0.12