Re: std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-16 Thread js.mdnq
On Saturday, 15 December 2012 at 19:01:23 UTC, ref2401 wrote: What does means 'maxRelDiff' parameter? I looked at the source code of this method and I still didn't get it. return fabs((lhs - rhs) / rhs) <= maxRelDiff || maxAbsDiff != 0 && fabs(lhs - rhs) <= maxAbsDiff; In what cases can I use

Re: std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-15 Thread ref2401
now i got it, thanks.

Re: std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-15 Thread Ali Çehreli
On 12/15/2012 11:01 AM, ref2401 wrote: What does means 'maxRelDiff' parameter? I looked at the source code of this method and I still didn't get it. return fabs((lhs - rhs) / rhs) <= maxRelDiff || maxAbsDiff != 0 && fabs(lhs - rhs) <= maxAbsDiff; In what cases can I use this parameter? If you

Re: std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-15 Thread ref2401
Maybe you want to use std.math.feqrel instead. that's not what i was asking about

Re: std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-15 Thread bearophile
ref2401: What does means 'maxRelDiff' parameter? I looked at the source code of this method and I still didn't get it. return fabs((lhs - rhs) / rhs) <= maxRelDiff || maxAbsDiff != 0 && fabs(lhs - rhs) <= maxAbsDiff; In what cases can I use this parameter? Maybe you want to use std.math.fe

std.math.approxEqual, 'maxRelDiff' parameter?

2012-12-15 Thread ref2401
What does means 'maxRelDiff' parameter? I looked at the source code of this method and I still didn't get it. return fabs((lhs - rhs) / rhs) <= maxRelDiff || maxAbsDiff != 0 && fabs(lhs - rhs) <= maxAbsDiff; In what cases can I use this parameter?