add Exp rules
however I find this might be conflict with BASIC rules which evals the pi * im expression, is there a way to treat Irrationals differently?
Update: I changed the is_constant and printings for Irrational, it looks working now! should fix #81
Codecov Report
Merging #80 into master will increase coverage by
4.3%. The diff coverage is80%.
@@ Coverage Diff @@
## master #80 +/- ##
=========================================
+ Coverage 88.47% 92.78% +4.3%
=========================================
Files 8 8
Lines 269 291 +22
=========================================
+ Hits 238 270 +32
+ Misses 31 21 -10
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/rules.jl | 92.18% <100%> (+0.95%) |
:arrow_up: |
| src/utils.jl | 75% <100%> (+8.33%) |
:arrow_up: |
| src/types.jl | 90.9% <50%> (+7.18%) |
:arrow_up: |
| src/match.jl | 97.01% <0%> (+0.34%) |
:arrow_up: |
| src/rule.jl | 98.59% <0%> (+4.65%) |
:arrow_up: |
| src/properties.jl | 71.42% <0%> (+9.89%) |
:arrow_up: |
| src/context.jl | 88.88% <0%> (+12.41%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 4711ded...c6f3c40. Read the comment docs.
it seems the rule of exp(2π * im) => 1 is not working when combined with :BASIC, since the definitions is
julia> dump(r)
PatternRule
left: Term
ex: Expr
head: Symbol call
args: Array{Any}((2,))
1: exp (function of type typeof(exp))
2: Expr
head: Symbol call
args: Array{Any}((3,))
1: * (function of type typeof(*))
2: Expr
head: Symbol call
args: Array{Any}((3,))
1: * (function of type typeof(*))
2: Int64 2
3: Irrational{:π} π = 3.1415926535897...
3: Complex{Bool}
re: Bool false
im: Bool true
right: Term
ex: Int64 1
ps: Array{Function}((0,))
but after :BASIC, the * expression will be treated as associative operator which is a list of all args instead of the binary tree.
I fixed this by defining it as exp(*(2, π, im)) => 1 but I'm wondering if there is some kind of better fix for associative operators?