From 4cdb2227089dc4ffada330d84f5ff1f6c2c0989d Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 10 Jan 2025 11:43:06 +0530 Subject: [PATCH] fix: fix `NaNMath.pow(::Num, ::Integer)` ambiguity --- src/Symbolics.jl | 4 +++- src/num.jl | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symbolics.jl b/src/Symbolics.jl index 55b98be20..1a70c7da2 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -47,6 +47,8 @@ import SymbolicLimits using ADTypes: ADTypes +using NaNMath + @reexport using SymbolicUtils RuntimeGeneratedFunctions.init(@__MODULE__) @@ -108,7 +110,7 @@ include("variable.jl") function slog end; function ssqrt end; function scbrt end include("linearity.jl") -using DiffRules, SpecialFunctions, NaNMath +using DiffRules, SpecialFunctions using SparseArrays diff --git a/src/num.jl b/src/num.jl index c3d3101e8..3b03d4880 100644 --- a/src/num.jl +++ b/src/num.jl @@ -25,6 +25,8 @@ SymbolicUtils.@number_methods( Num(f(value(a), value(b))), [conj, real, transpose] ) + +NaNMath.pow(x::Num, y::Integer) = wrap(NaNMath.pow(unwrap(x), y)) Base.conj(x::Num) = x Base.transpose(x::Num) = x