diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2009-03-30 11:48:46 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2009-04-01 09:39:55 (GMT) |
commit | 14d9633f576429b29257ed43143abc6de3918e5d (patch) | |
tree | 3167fa3877af6ae10ce1488d0b68b7034c25c337 /src/corelib/global | |
parent | 914c2c25d0a60bc5c9d14f405a49b08a162c8908 (diff) | |
download | Qt-14d9633f576429b29257ed43143abc6de3918e5d.zip Qt-14d9633f576429b29257ed43143abc6de3918e5d.tar.gz Qt-14d9633f576429b29257ed43143abc6de3918e5d.tar.bz2 |
Adding note to the qFuzzyCompare doc
Adding note about how comparing using 0.0 will fail, and
an example on how to do it.
Reviewed-by: David Boddie
Reviewed-by: Geir Vattekar
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 68c213e..69d0a53 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2942,7 +2942,12 @@ bool QInternal::callFunction(InternalFunction func, void **args) Compares the floating point value \a p1 and \a p2 and returns \c true if they are considered equal, otherwise \c false. - + + Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. + The solution to this is to compare against values greater than or equal to 1.0 + + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 + The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. */ |