In addition to the above answers, notice that the value of k
will be different than what you originally assigned it. It will only have about 15 or 16 digits of precision (most of the time this is more than you will need).
k <- 1200.0000002161584854
sprintf('%1.29f',k)
"1200.00000021615846890199463814497"
Note that there are libraries where you can increase precision, such as gmp
, but they are designed around integers.