i.e. there is a loss of precision when going to a list. I will later convert the floats into strings like 0p4 and this will mess up things. Do you know how to prevent this?

Not all numbers are representable as a (finite) binary (floating point) number. For example 1/5=0.2 is not, similar to how 1/3=0.3333… is not representable as a (finite) decimal number.

The values you get are probably the (exact) floating point values that are closest to the real numbers you want.