fixed bug in float point decoding. previously failed when exponent<0.

This commit is contained in:
Robert Johansson 2012-07-24 23:59:20 +09:00
parent 989fdbd7ee
commit ed61932579

View File

@ -601,7 +601,7 @@ mbus_data_float_decode(u_char *float_data)
}
// calculate float value
val = (float) sign * fraction * pow(2.0f, -23.0f) * (1 << exponent);
val = (float) sign * fraction * pow(2.0f, -23.0f + exponent);
return val;
}