On 24 December 2010 18:22, Wes McKinney <[email protected]> wrote:
>
> Tried this and no luck. I'd say it's definitely a 0.14 bug (I nuked
> everything tried 0.14 and it failed, then nuked everything again,
> installed 0.13 and things are back to working).
>
> Let me know how I can help debug.
>

OK, now I understand what's going on. I seems Cython 0.14 do not
actually have the fix I was talking about. Any chance you could
install cython from github repo and give another try?

Alternatively, you could apply the patch below to your copy of  0.14
and rebuild+install Cython.


$ git show 29efcd449d933cab1405b98530e6272dea683987
commit 29efcd449d933cab1405b98530e6272dea683987
Author: Lisandro Dalcin <[email protected]>
Date:   Mon Dec 13 20:10:55 2010 -0300

    MSVC: fixes for complex types

diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py
index 38df20d..bde7356 100755
--- a/Cython/Compiler/PyrexTypes.py
+++ b/Cython/Compiler/PyrexTypes.py
@@ -1371,10 +1371,10 @@ impl="""
     }
     #if %(is_float)s
         static CYTHON_INLINE %(real_type)s __Pyx_c_abs%(m)s(%(type)s z) {
-          #if HAVE_HYPOT
-            return hypot%(m)s(z.real, z.imag);
-          #else
+          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
             return sqrt%(m)s(z.real*z.real + z.imag*z.imag);
+          #else
+            return hypot%(m)s(z.real, z.imag);
           #endif
         }
         static CYTHON_INLINE %(type)s __Pyx_c_pow%(m)s(%(type)s a,
%(type)s b) {
diff --git a/tests/run/complex_numbers_T305.pyx
b/tests/run/complex_numbers_T305.pyx
index f743330..9bcafe7 100644
--- a/tests/run/complex_numbers_T305.pyx
+++ b/tests/run/complex_numbers_T305.pyx
@@ -28,8 +28,8 @@ def test_pow(double complex z, double complex w, tol=None):
     Various implementations produce slightly different results...

     >>> a = complex(3, 1)
-    >>> test_pow(a, 1)
-    (3+1j)
+    >>> test_pow(a, 1, 1e-15)
+    True
     >>> test_pow(a, 2, 1e-15)
     True
     >>> test_pow(a, a, 1e-15)
@@ -48,7 +48,7 @@ def test_int_pow(double complex z, int n, tol=None):
     [True, True, True, True, True, True, True, True, True]
     >>> [test_int_pow(complex(0, 2), k, 1e-15) for k in range(-4, 5)]
     [True, True, True, True, True, True, True, True, True]
-    >>> [test_int_pow(complex(2, 0.5), k, 1e-15) for k in range(0, 10)]
+    >>> [test_int_pow(complex(2, 0.5), k, 1e-14) for k in range(0, 10)]
     [True, True, True, True, True, True, True, True, True, True]
     """
     if tol is None:



-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to