Get parameter value by code

Hello,
I working with some code where i need to read paremeter value in code.
i used the previously used method
enum ap_var_type vtype;
AP_Param *vp1 = find(pname[0], &vtype);
float value1 = ((AP_Float *)vp1)->get();

pname is 2d array in that i wrote parameter name.
it is working well with integer value or float values whose binary representation in 32-bit and 64-bit are same
e.g. param_value = 0.5
32-bit → 00111111 00000000 00000000 00000000
64-bit → 00111111 11100000 00000000 00000000 00000000 00000000 00000000 00000000
In this, I am getting the same value as 0.5.

but if the parameter value is e.g. 0.8, whose binary representation in 32-bit and 64-bit different,
32-bit → 00111111 01001100 11001100 11001101
64-bit → 00111111 11101001 10011001 10011001 10011001 10011001 10011001 10011010
In this, I am getting a parameter value of 0.800000012.

Can anyone help me to get original paremeter value.

This is basic binary coding issue, independent of Ardupilot

0.8 is not possible to represent in in float32. In float32 the closest number is 0.800000012
0.8 is not possible to represent in in float64. In float64 the closest number is 0.80000000000000006 or something like that. when you print it you do get 0.8 but the number is not really 0.8

0.5 is possible to represent without error in both float32 and float64.

Please use Wikipedia to find out more about floating point rounding and precision limitations.

Can you help me with round up/down to get exact parameter value,