From bdd31ecf5563904c8f968ba4a384d77c630ef328 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Mon, 25 Sep 2023 11:55:50 +0100 Subject: [PATCH] Use BaseType.jl instead of Base.one to get scalar --- Project.toml | 2 ++ src/QuadGK.jl | 2 +- src/gausskronrod.jl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 86907ba..c2fe7d2 100644 --- a/Project.toml +++ b/Project.toml @@ -3,10 +3,12 @@ uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" version = "2.9.1" [deps] +BaseType = "7fbed51b-1ef5-4d67-9085-a4a9b26f478c" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [compat] +BaseType = "0.2" DataStructures = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19" julia = "1.2" diff --git a/src/QuadGK.jl b/src/QuadGK.jl index 90c8681..47dfdaf 100644 --- a/src/QuadGK.jl +++ b/src/QuadGK.jl @@ -26,7 +26,7 @@ module QuadGK export quadgk, quadgk!, gauss, kronrod, alloc_segbuf, quadgk_count, quadgk_print export BatchIntegrand -using DataStructures, LinearAlgebra +using DataStructures, LinearAlgebra, BaseType import Base.Order.Reverse # an in-place integrand function f!(result, x) and diff --git a/src/gausskronrod.jl b/src/gausskronrod.jl index f010474..d30c6d1 100644 --- a/src/gausskronrod.jl +++ b/src/gausskronrod.jl @@ -569,4 +569,4 @@ end end cachedrule(::Type{T}, n::Integer) where {T<:Number} = - _cachedrule(typeof(float(real(one(T)))), Int(n)) + _cachedrule(typeof(float(one(base_numeric_type(T)))), Int(n))