[Development] Implementation of qFuzzyCompare and zero values

Thiago Macieira thiago.macieira at intel.com
Thu Jul 25 17:26:21 CEST 2013


On quinta-feira, 25 de julho de 2013 09:17:36, André Somers wrote:
> static inline bool qFuzzyComparePossibleNulls(double p1, double p2)
> {
>      if (qFuzzyIsNull(p1)) {
>          return qFuzzyIsNull(p2);
>      } else if (qFuzzyIsNull(p2)) {
>          return false;
>      } else {
>          return qFuzzyCompare(p1, p2);
>      }
> }

if ((qFuzzyIsNull(p1) && qFuzzyIsNull(p2)) || qFuzzyCompare(p1, p2))

If p1 is zero, qFuzzyCompare(p1, p2) will return false unless p2 is also zero.

But, no, I think we need something like what Jan-Arve is suggesting.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130725/7a9fc2d7/attachment.sig>


More information about the Development mailing list