From: Stefan Behnel Date: Sun, 8 Mar 2009 12:42:46 +0000 (+0100) Subject: extended test case to also cover ticket #6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2996bded2f8e7fcd218bc123895287a4df7f2ab7;p=cython.git extended test case to also cover ticket #6 --- diff --git a/tests/run/specialfloat.pyx b/tests/run/specialfloat.pyx index dfbe04bb..af96fa2a 100644 --- a/tests/run/specialfloat.pyx +++ b/tests/run/specialfloat.pyx @@ -44,6 +44,11 @@ __doc__ = u""" -inf >>> float_infn == float('-inf') True + + >>> global_floats()[1:] == (float('+inf'), float('-inf')) + True + >>> global_floats()[0] + nan """ DEF FLOAT = 12.5 @@ -51,6 +56,10 @@ DEF FLOAT_NAN = float('nan') DEF FLOAT_INFP = float('+inf') DEF FLOAT_INFN = float('-inf') +cdef double cdef_float_nan = float('nan') +cdef double cdef_float_infp = float('+inf') +cdef double cdef_float_infn = float('-inf') + float_nan = FLOAT_NAN float_infp = FLOAT_INFP float_infn = FLOAT_INFN @@ -105,3 +114,5 @@ def infn3(): f = FLOAT_INFN return f +def global_floats(): + return (cdef_float_nan, cdef_float_infp, cdef_float_infn)