LibC: Fix printf e/E modifier for negative exponents
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user