Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-26 Thread Thiago Macieira
On sexta-feira, 26 de julho de 2013 10:53:19, Juan Navarro wrote: > In my opinion, if a function requires the user to provide a magnitude value > (for whatever reason), then that value should be explicitly given in an > additional parameter, not implicitly given as an added value to the already > g

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-26 Thread Juan Navarro
On Thu, Jul 25, 2013 at 5:26 PM, Thiago Macieira wrote: > > if ((qFuzzyIsNull(p1) && qFuzzyIsNull(p2)) || qFuzzyCompare(p1, p2)) > > That's exactly like the macro with which I end up "convering" the current Qt implementation. On your first reply, you also said that On Thu, Jul 25, 2013 at 1:19 AM

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-25 Thread Thiago Macieira
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 { > r

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-25 Thread Saether Jan-Arve
e From: development-bounces+jan-arve.saether=digia@qt-project.org [mailto:development-bounces+jan-arve.saether=digia@qt-project.org] On Behalf Of Laszlo Papp Sent: 25. juli 2013 09:47 To: André Somers Cc: development@qt-project.org Subject: Re: [Development] Implementation of qFuzzyCompare and zer

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-25 Thread Laszlo Papp
On Thu, Jul 25, 2013 at 6:34 AM, André Somers wrote: > Would it be an option to _add_ a qFuzzyCompareMightBeNull or something > like that then for cases like Juan describes where you don't know if one > of the two values might be zero or not? There is no reason to change the > behaviour of the cur

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-25 Thread Thiago Macieira
On quinta-feira, 25 de julho de 2013 07:34:19, André Somers wrote: > Would it be an option to _add_ a qFuzzyCompareMightBeNull or something > like that then for cases like Juan describes where you don't know if one > of the two values might be zero or not? There is no reason to change the > behavio

Re: [Development] Implementation of qFuzzyCompare and zero values

2013-07-24 Thread Thiago Macieira
On quarta-feira, 24 de julho de 2013 20:32:26, Juan Navarro wrote: > Hello all, > > I’m using qFuzzyCompare(a, b) in order to handle all floating point > comparisons, but it has severe limitations when a or b may be zero. > > Somewhere in the docs it is recommended to add +1 to the values, but this

[Development] Implementation of qFuzzyCompare and zero values

2013-07-24 Thread Juan Navarro
Hello all, I’m using qFuzzyCompare(a, b) in order to handle all floating point comparisons, but it has severe limitations when a or b may be zero. Somewhere in the docs it is recommended to add +1 to the values, but this is not a really useful suggestion because some of the values might be -1.0,