diff options
author | John McCall <rjmccall@apple.com> | 2009-12-24 23:18:09 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-24 23:18:09 +0000 |
commit | 6a09affdf62fccbd190ca6e9cac0cb065b5f2677 (patch) | |
tree | cc8026e6624f0de46a1c8a4e21cdd4d9fb284f41 /unittests | |
parent | c883ad2dd8d4861f6c2cbc89f079152a159778c8 (diff) |
Implement support for converting to string at "natural precision", and fix some
major bugs in long-precision conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/APFloatTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp index d2a977a05c..76cdafcf3f 100644 --- a/unittests/ADT/APFloatTest.cpp +++ b/unittests/ADT/APFloatTest.cpp @@ -329,8 +329,10 @@ TEST(APFloatTest, toString) { ASSERT_EQ("1.01E+4", convertToString(1.01E+4, 4, 2)); ASSERT_EQ("1.01E+4", convertToString(1.01E+4, 5, 1)); ASSERT_EQ("0.0101", convertToString(1.01E-2, 5, 2)); - ASSERT_EQ("1.01E-2", convertToString(1.01E-2, 4, 2)); + ASSERT_EQ("0.0101", convertToString(1.01E-2, 4, 2)); ASSERT_EQ("1.01E-2", convertToString(1.01E-2, 5, 1)); + ASSERT_EQ("0.7853981633974483", convertToString(0.78539816339744830961, 0, 3)); + ASSERT_EQ("4.940656458412465E-324", convertToString(4.9406564584124654e-324, 0, 3)); } #ifdef GTEST_HAS_DEATH_TEST |