You are overlapping your floats consequently corrupting the already stored data of 0, 1 & 2.
A float takes 4 bytes but you store them in 1 byte increments.
You can use sizeof(float)
to store the individual values but I’d rather store the entire array as one entity.