0.1 is a number that can be exactly represented by a Float16, or Float32, or a Float64.
(at least according to how we print them)
But not it would seem (at least according to printing) by a BigFloat.
Julia prints the shortest value that uniquely identifies the float in question when parsed back. The algorithm in question is called “Ryu”, you can find the julia implementation here.
I think part of the confusion is that the Julia expression 0.1is a Float64 close, but not equal to 1//10. So Float64(0.1) is really the same thing as 0.1. I try always to be careful to distinguish 0.1 and 1/10 = 0.1 which are different (Julia left and common number right.)
This also implies that a == 0.30000000000000004 is the correctly rounded answer to the question 0.1 + 0.2 == ? with rounding error 0.00000000000000002 (and not 0.00000000000000004 as one might think.)