Bug report
Issue details
Invoking ftoa_engine (low-level function responsible for formatting floating point numbers, used by GCS::send_text) enters an infinite loop when invoked as below:
char *buf = (char*)malloc(255);
ftoa_engine(1e-44f, buf, 7, 7);
This appears to happen with other very small numbers (around e-44 exponent), and results in an infinite loop here, as prod and decimal are both zero:
|
while ((prod -= decimal) >= 0) |
Adding the following to the start of the function seems to be a workable fix, although it may break the formatting of very small (denormalized) floats:
if (fabsf(val) < FLT_MIN) val = 0.0f;
Version
Plane Stable 4.6.2
Platform
[x] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Airframe type
n/a
Hardware type
n/a
Logs
n/a