Ticket #11334: trac_11334-divide-v2.patch

File trac_11334-divide-v2.patch, 2.1 KB (added by fbissey, 7 years ago)

fix non riemann.pyx divivde by zero warnings

  • sage/functions/hyperbolic.py

    # HG changeset patch
    # User Francois Bissey <francois.bissey@canterbury.ac.nz>
    # Date 1363859472 -46800
    # Node ID 04672e3f53435618ce58a87ac95d677962edec26
    # Parent  d5f2dfc014530707f8a3744f4867c0073e08c0b9
    trac 11334: fix all numpy's divide warning
    
    diff --git a/sage/functions/hyperbolic.py b/sage/functions/hyperbolic.py
    a b  
    608608            sage: import numpy
    609609            sage: a = numpy.linspace(0,1,3)
    610610            sage: arcsech(a)
    611             Warning: divide by zero encountered in divide
     611            doctest:614: RuntimeWarning: divide by zero encountered in divide
    612612            array([       inf,  1.3169579,  0.       ])
    613613        """
    614614        return arccosh(1.0 / x)
     
    658658            sage: import numpy
    659659            sage: a = numpy.linspace(0,1,3)
    660660            sage: arccsch(a)
    661             Warning: divide by zero encountered in divide
     661            doctest:664: RuntimeWarning: divide by zero encountered in divide
    662662            array([        inf,  1.44363548,  0.88137359])
    663663        """
    664664        return arcsinh(1.0 / x)
  • sage/modules/vector_double_dense.pyx

    diff --git a/sage/modules/vector_double_dense.pyx b/sage/modules/vector_double_dense.pyx
    a b  
    710710            0.953760808...
    711711            sage: w = vector(CDF, [-1,0,1])
    712712            sage: w.norm(p=-1.6)
    713             Warning: divide by zero encountered in power
     713            doctest:1992: RuntimeWarning: divide by zero encountered in power
    714714            0.0
    715715
    716716        Return values are in ``RDF``, or an integer when ``p = 0``.  ::
  • sage/symbolic/function.pyx

    diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx
    a b  
    622622            sage: import numpy
    623623            sage: a = numpy.arange(5)
    624624            sage: csc(a)
    625             Warning: divide by zero encountered in divide
     625            doctest:270: RuntimeWarning: divide by zero encountered in divide
    626626            array([        inf,  1.18839511,  1.09975017,  7.0861674 , -1.32134871])
    627627
    628628            sage: factorial(a)