intrval icon indicating copy to clipboard operation
intrval copied to clipboard

floating point number comparisons

Open achubaty opened this issue 7 months ago • 1 comments

This is a useful package, I'm sad I hadn't started using it sooner!

Have you considered using more robust comparisons to deal with floating point number problems? See below.

> x1 <- 0.5 - 0.3
> x2 <- 0.3 - 0.1
> 
> x1 %[]% c(0.2, 0.6)
[1] TRUE
> x2 %[]% c(0.2, 0.6)
[1] FALSE

My fpCompare package deals with this for the basic relational operators, but having equivalent functionality to test intervals/ranges may be useful. Although, I recognize that this kind of change may break backwards compatibility / reproducibility without a mechanism (package option?) to use the alternate behaviour.

achubaty avatar Jul 09 '24 21:07 achubaty