From 74db93ed2d0677bbca8ba85617f05eae745363d8 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 31 Oct 2020 13:16:14 -0700 Subject: Preserve signed zero on roundtrip This commit removes the previous mechanism of differentiating between "Debug" and "Display" formattings for the sign of -0 so as to comply with the IEEE 754 standard's requirements on external character sequences preserving various attributes of a floating point representation. In addition, numerous tests are fixed. --- library/alloc/tests/fmt.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'library/alloc/tests') diff --git a/library/alloc/tests/fmt.rs b/library/alloc/tests/fmt.rs index 757fddd2418..ade3bc2d334 100644 --- a/library/alloc/tests/fmt.rs +++ b/library/alloc/tests/fmt.rs @@ -154,8 +154,7 @@ fn test_format_macro_interface() { t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6"); // Float edge cases - t!(format!("{}", -0.0), "0"); - t!(format!("{:?}", -0.0), "-0.0"); + t!(format!("{}", -0.0), "-0"); t!(format!("{:?}", 0.0), "0.0"); // sign aware zero padding -- cgit 1.4.1-3-g733a5