a <- 10
b <- 10.02
paste(a-b)
#[1] "-0.0199999999999996"
library(Rmpfr)
mpfr(10.02, 100)
#1 'mpfr' number of precision 100 bits
#[1] 1.001999999999999957367435854394e1
Note: similar question was posted elsewhere (Why are these numbers not equal?), but this question is slightly different due to the context it has: the problem is found when I perform paste() or str_c() function, so other users who search paste would be redirected to this post and find their answers. Besides, the comments contain interesting thoughts and answers, which are not seen in the previous post.