mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Fixed issue #178.
This commit is contained in:
@@ -314,7 +314,8 @@ namespace bx
|
|||||||
if (p2 < delta)
|
if (p2 < delta)
|
||||||
{
|
{
|
||||||
*K += kappa;
|
*K += kappa;
|
||||||
GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * s_kPow10[-kappa]);
|
const int index = -static_cast<int>(kappa);
|
||||||
|
GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? s_kPow10[-static_cast<int>(kappa)] : 0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,6 +274,7 @@ TEST_CASE("toString double", "")
|
|||||||
REQUIRE(testToString(0.0000000001, "1e-10") );
|
REQUIRE(testToString(0.0000000001, "1e-10") );
|
||||||
REQUIRE(testToString(-270.000000, "-270.0") );
|
REQUIRE(testToString(-270.000000, "-270.0") );
|
||||||
REQUIRE(testToString(2.225073858507201e-308, "2.225073858507201e-308") );
|
REQUIRE(testToString(2.225073858507201e-308, "2.225073858507201e-308") );
|
||||||
|
REQUIRE(testToString(-79.39773355813419, "-79.39773355813419") );
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool testFromString(double _value, const char* _input)
|
static bool testFromString(double _value, const char* _input)
|
||||||
|
|||||||
Reference in New Issue
Block a user