In R, I find it a bit annoying to have to transform easy-to-read code like:
if (det(A) == 1) # not always working because of floating point precision
...
to
if (abs(det(A) - 1) < .Machine$double.eps) # working but bad for readability
...
Question: is there a built-in operator in R that tests if values are equal "up to a .Machine$double.eps
error"? Something like:
if (det(A) ==~ 1) # TRUE even if det(A) = 1 + 1e-17
...