Given below the test code and its output. When I get float value from number value, precision is lost.. Can anyone tell me why this behaviour and also how to handle this? >
All data types have representation limits so the fact there is a limit shouldn't be surprising.
float uses 24-bit for its "mantissa" which holds all the significant digits. This means it has about 7 digits of precision (as 2^^24 is about 16 million)
double uses 53-bit for it "mantissa" so it can hold about 16 digits accurately.