Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Apr 2, 2021
1 parent d3fd84b commit 2848729
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/extra_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function derivative(::typeof(max), args::NTuple{2,Any}, ::Val{2})
IfElse.ifelse(x > y, zero(y), one(y))
end

IfElse.ifelse(x::Num,y,z) = Num(Term{Real}(IfElse.ifelse, [value(x), value(y), value(z)]))

@register Base.rand(x)
@register Base.randn(x)

Expand Down
2 changes: 2 additions & 0 deletions src/num.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Base.typemin(::Type{Num}) = Num(-Inf)
Base.typemax(::Type{Num}) = Num(Inf)
Base.float(x::Num) = x

IfElse.ifelse(x::Num,y,z) = Num(IfElse.ifelse(value(x), value(y), value(z)))

Base.promote_rule(::Type{Bool}, ::Type{<:Num}) = Num
for C in [Complex, Complex{Bool}]
@eval begin
Expand Down

0 comments on commit 2848729

Please sign in to comment.