I have been banging my head against this for a couple hours now, and I'm not any closer to understanding it. Why does the following R code return a value of FALSE?
any(seq(27.17,137.74,by=0.01) == 27.38)
[1] FALSE
seq(27.17,137.74,by=0.01)[22]
[1] 27.38
seq(27.17,137.74,by=0.01)[22] == 27.38
[1] FALSE
Whether R can find a given value in the sequence seems almost random:
seq(27.38,27.43,by=0.01) %in% seq(27.17,137.74,by=0.01)
[1] FALSE TRUE FALSE TRUE FALSE FALSE
seq(27.39,27.45,by=0.01) %in% seq(27.17,137.74,by=0.01)
[1] TRUE TRUE TRUE TRUE FALSE TRUE FALSE
Is this a bug? I am trying to perform operations on a vector of dollar and cent values, and this is making it impossible.