From b4c9ca285315b4700c25e740078766f9dbf2ce98 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 2 Jan 2008 12:52:32 +0100 Subject: [PATCH] tests for '**' operator --- tests/broken/powop.pyx | 4 ---- tests/run/powop.pyx | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) delete mode 100644 tests/broken/powop.pyx create mode 100644 tests/run/powop.pyx diff --git a/tests/broken/powop.pyx b/tests/broken/powop.pyx deleted file mode 100644 index 2a083582..00000000 --- a/tests/broken/powop.pyx +++ /dev/null @@ -1,4 +0,0 @@ -def f(obj1, obj2, obj3): - cdef float flt1, flt2, flt3 - flt1 = flt2 ** flt3 - obj1 = obj2 ** obj3 diff --git a/tests/run/powop.pyx b/tests/run/powop.pyx new file mode 100644 index 00000000..c8633ead --- /dev/null +++ b/tests/run/powop.pyx @@ -0,0 +1,26 @@ +__doc__ = """ + >>> f(1.0, 2.95)[0] == f(1.0, 2.95)[1] + True + + >>> constant_py() + 1024L + + >>> constant_long() == 2L ** 36 + True +""" + +def f(obj2, obj3): + cdef float flt1, flt2, flt3 + flt2, flt3 = obj2, obj3 + + flt1 = flt2 ** flt3 + obj1 = obj2 ** obj3 + return flt1, obj1 + +def constant_py(): + result = 2L ** 10 + return result + +def constant_long(): + result = 2L ** 36 + return result -- 2.26.2