From 37067666ee24b018f260a011375f65aa69b49041 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 1 May 2014 21:21:43 +0100 Subject: Fix the builtin min() and max() functions (and add tests). Fixes #539 --- tests/float/builtin-float-minmax.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/float/builtin-float-minmax.py (limited to 'tests/float') diff --git a/tests/float/builtin-float-minmax.py b/tests/float/builtin-float-minmax.py new file mode 100644 index 000000000..ce45a768a --- /dev/null +++ b/tests/float/builtin-float-minmax.py @@ -0,0 +1,26 @@ +# test builtin min and max functions with float args + +print(min(0,1.0)) +print(min(1.0,0)) +print(min(0,-1.0)) +print(min(-1.0,0)) + +print(max(0,1.0)) +print(max(1.0,0)) +print(max(0,-1.0)) +print(max(-1.0,0)) + +print(min(1.5,-1.5)) +print(min(-1.5,1.5)) + +print(max(1.5,-1.5)) +print(max(-1.5,1.5)) + +print(min([1,2.9,4,0,-1,2])) +print(max([1,2.9,4,0,-1,2])) + +print(min([1,2.9,4,6.5,-1,2])) +print(max([1,2.9,4,6.5,-1,2])) +print(min([1,2.9,4,-6.5,-1,2])) +print(max([1,2.9,4,-6.5,-1,2])) + -- cgit v1.2.3