[poincare] PrintFloat: fix bufferSizeForFloatsWithPrecision (worst case

is -1.234567E-201 for 7 significative digits)
This commit is contained in:
Émilie Feral
2018-11-21 10:51:16 +01:00
parent 5f24c5993c
commit 56932fbe04

View File

@@ -10,8 +10,8 @@ class Integer;
namespace PrintFloat {
constexpr static int bufferSizeForFloatsWithPrecision(int numberOfSignificantDigits) {
// The wors case is -1.234E-38
return numberOfSignificantDigits + 7;
// The wors case is -1.234E-328
return numberOfSignificantDigits + 8;
}
/* This function prints the integer i in the buffer with a '.' at the position
* specified by the decimalMarkerPosition. It starts printing at the end of the