std.math.approxEqual, 'maxRelDiff' parameter?
bearophile
bearophileHUGS at lycos.com
Sat Dec 15 11:11:58 PST 2012
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.feqrel instead.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list