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.