From: Stefan Behnel Date: Wed, 2 Jan 2008 11:52:32 +0000 (+0100) Subject: tests for '**' operator X-Git-Tag: 0.9.6.14~53 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b4c9ca285315b4700c25e740078766f9dbf2ce98;p=cython.git tests for '**' operator --- 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