[Rd] compairing doubles

Iñaki Ucar iuc@r @ending from fedor@project@org
Fri Aug 31 17:31:19 CEST 2018


El vie., 31 ago. 2018 a las 17:08, Serguei Sokol
(<sokol using insa-toulouse.fr>) escribió:
>
> Le 31/08/2018 à 16:25, Mark van der Loo a écrit :
> > Ah, my bad, you're right of course.
> >
> > sum(abs(diff(diff( sort(x))))) < eps
> >
> > for some reasonable eps then, would do as a oneliner, or
> >
> > all(abs(diff(diff(sort(x)))) < eps)
> >
> > or
> >
> > max(abs(diff(diff(sort(x))))) < eps
> Or with only four function calls:
> diff(range(diff(sort(x)))) < eps

We may have a winner... :)

Iñaki



More information about the R-devel mailing list