LibC: Fix printf e/E modifier for negative exponents

This commit is contained in:
Bananymous 2025-05-04 13:41:06 +03:00
parent abf7c8e68a
commit d457e6ad6a
1 changed files with 2 additions and 2 deletions

View File

@ -240,9 +240,9 @@ static void floating_point_to_exponent_string(char* buffer, T value, bool upper,
// Calculate which number to put as exponent
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);
}