Skip to content

Commit

Permalink
feat: Add support for extra keyword arguments to Div and Pow
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Nov 14, 2024
1 parent 710f871 commit 3b264aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ function maybe_intcoeff(x)
end
end

function Div{T}(n, d, simplified=false; metadata=nothing) where {T}
function Div{T}(n, d, simplified=false; metadata=nothing, kwargs...) where {T}
if T<:Number && !(T<:SafeReal)
n, d = quick_cancel(n, d)
end
Expand Down Expand Up @@ -518,15 +518,15 @@ end

@inline denominators(x) = isdiv(x) ? numerators(x.den) : Any[1]

function Pow{T}(a, b; metadata=NO_METADATA) where {T}
function Pow{T}(a, b; metadata=NO_METADATA, kwargs...) where {T}
_iszero(b) && return 1
_isone(b) && return a
s = Pow{T}(; base=a, exp=b, arguments=[], metadata)
BasicSymbolic(s)
end

function Pow(a, b; metadata=NO_METADATA)
Pow{promote_symtype(^, symtype(a), symtype(b))}(makepow(a, b)..., metadata=metadata)
function Pow(a, b; metadata = NO_METADATA, kwargs...)
Pow{promote_symtype(^, symtype(a), symtype(b))}(makepow(a, b)...; metadata, kwargs...)
end

function toterm(t::BasicSymbolic{T}) where T
Expand Down

0 comments on commit 3b264aa

Please sign in to comment.