Skip to content

Commit

Permalink
Merge pull request #997 from oscardssmith/extend-issymbollike
Browse files Browse the repository at this point in the history
extend `RecursiveArrayTools.issymbollike` for `Num`
  • Loading branch information
ChrisRackauckas authored Oct 14, 2023
2 parents e2f5726 + 6f75be0 commit 84c23db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
Expand Down Expand Up @@ -63,6 +64,7 @@ MacroTools = "0.5"
NaNMath = "0.3, 1"
PrecompileTools = "1"
RecipesBase = "1.1"
RecursiveArrayTools = "2"
Reexport = "0.2, 1"
ReferenceTests = "0.9"
Requires = "1.1"
Expand Down
3 changes: 3 additions & 0 deletions src/num.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,6 @@ function Base.Docs.getdoc(x::Num)
end
Markdown.parse(join(strings, "\n\n "))
end

using RecursiveArrayTools
RecursiveArrayTools.issymbollike(::Union{BasicSymbolic,Num}) = true
5 changes: 4 additions & 1 deletion test/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ z2 = c + d * im
@test sign(Num(1)) isa Num
@test isequal(sign(Num(1)), Num(1))
@test isequal(sign(Num(-1)), Num(-1))

@test isequal(ℯ^a, exp(a))

using IfElse: ifelse
Expand Down Expand Up @@ -237,3 +237,6 @@ for f in [<, <=, >, >=, isless]
end

@test_nowarn binomial(t, 1)

using RecursiveArrayTools
@test RecursiveArrayTools.issymbollike(t)

0 comments on commit 84c23db

Please sign in to comment.