I am making a simple sequence. Why is this true?
Browse[1]> seq(7.4, 12.7, 0.001)[2] == 7.401
[1] FALSE
Browse[1]> seq(7.4, 12.7, 0.001)[2] == '7.401'
[1] TRUE
I am making a simple sequence. Why is this true?
Browse[1]> seq(7.4, 12.7, 0.001)[2] == 7.401
[1] FALSE
Browse[1]> seq(7.4, 12.7, 0.001)[2] == '7.401'
[1] TRUE
That is a floating point (tolerance) error. Try,
round(seq(7.4, 12.7, 0.001)[2], 3) == 7.401
#TRUE