LibC: Fix printf e/E modifier for negative exponents
This commit is contained in:
parent
abf7c8e68a
commit
d457e6ad6a
|
@ -240,9 +240,9 @@ static void floating_point_to_exponent_string(char* buffer, T value, bool upper,
|
||||||
|
|
||||||
// Calculate which number to put as exponent
|
// Calculate which number to put as exponent
|
||||||
int exponent = 0;
|
int exponent = 0;
|
||||||
if (value != (T)0.0)
|
if (value != static_cast<T>(0.0))
|
||||||
{
|
{
|
||||||
exponent = (int)BAN::Math::log10<T>(value);
|
exponent = BAN::Math::floor<T>(BAN::Math::log10<T>(value));
|
||||||
value /= BAN::Math::pow<T>(10.0, exponent);
|
value /= BAN::Math::pow<T>(10.0, exponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue