summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-07-31 15:43:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-27 07:57:23 +0200
commite37001aad7f6e4bbad250addba033f1eaf97d566 (patch)
treee83a70da7f50edd967128f84df18287e805e30a9 /src/plugins/platforms
parent88999e9ea037ee79557d0c012ad9fdfc72fb5ece (diff)
Say hello to qFloatDistance()
This function is useful if a floating point comparison requires a certain precision. The return value can be considered as the precision. For instance, if you want to compare two 32-bit floating point values and all you need is a 24-bit precision, you can use this function like this: if (qFloatDistance(a,b) < (1 << 7)) { // The last 7 bits are not // significant // precise enough } Task-number: QTBUG-32632 Change-Id: I020a58d2f9f9452ac3c510b4bb560dc806f0d93c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms')
0 files changed, 0 insertions, 0 deletions