This is a very noob question, but I am curious to know the reason behind this: -If I debug the following C++ code:
void floatreturn(float i){
//nothing
}
int main(){
float a = 23.976;
floatreturn(a);
return 0;
}
Monitoring the passed value of a, it appears to be 23.9759998 when entering floatreturn. As a result, any processing of the value in the function would require to manually tweak the precision. Is there a reason for this, and any way to avoid it?