# 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 sage: import numpy sage: a = numpy.linspace(0,1,3) sage: arcsech(a) Warning: divide by zero encountered in divide doctest:614: RuntimeWarning: divide by zero encountered in divide array([       inf,  1.3169579,  0.       ]) """ return arccosh(1.0 / x) sage: import numpy sage: a = numpy.linspace(0,1,3) sage: arccsch(a) Warning: divide by zero encountered in divide doctest:664: RuntimeWarning: divide by zero encountered in divide array([        inf,  1.44363548,  0.88137359]) """ 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 0.953760808... sage: w = vector(CDF, [-1,0,1]) sage: w.norm(p=-1.6) Warning: divide by zero encountered in power doctest:1992: RuntimeWarning: divide by zero encountered in power 0.0 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 sage: import numpy sage: a = numpy.arange(5) sage: csc(a) Warning: divide by zero encountered in divide doctest:270: RuntimeWarning: divide by zero encountered in divide array([        inf,  1.18839511,  1.09975017,  7.0861674 , -1.32134871]) sage: factorial(a)