From 79474c6b164fb66a8d348bfa57613f9dbf5af4e8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 28 May 2015 14:22:12 +0000 Subject: py: Remove unnecessary extra handling of padding of nan/inf. C's printf will pad nan/inf differently to CPython. Our implementation originally conformed to C, now it conforms to CPython's way. Tests for this are also added in this patch. --- tests/float/string_format.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/float/string_format.py') diff --git a/tests/float/string_format.py b/tests/float/string_format.py index b5ff68b8c..265efedec 100644 --- a/tests/float/string_format.py +++ b/tests/float/string_format.py @@ -23,6 +23,10 @@ test("{:10.4F}", -123.456) test("{:10.4G}", 123.456) test("{:10.4G}", -123.456) +test("{:06e}", float("inf")) +test("{:06e}", float("-inf")) +test("{:06e}", float("nan")) + # The following fails right now #test("{:10.1}", 0.0) -- cgit v1.2.3