From 01f6c8657645e35d8b5f6855122f8d6698386923 Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Tue, 21 Feb 2017 13:30:56 +0100 Subject: [PATCH] Avoid ZeroDivisionError --- wafo/integrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wafo/integrate.py b/wafo/integrate.py index f3382b3..6e388c5 100644 --- a/wafo/integrate.py +++ b/wafo/integrate.py @@ -1114,7 +1114,7 @@ class _Quadgr(object): return Q, err def _integrate(self, fun, a, b, abseps, max_iter): - dtype = np.result_type(fun(a), fun(b)) + dtype = np.result_type(fun((a+b)/2), fun((a+b)/4)) # Initiate vectors Q0 = zeros(max_iter, dtype=dtype) # Quadrature