Skip to content

Commit

Permalink
Add tests for float32 arguments (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
oshikiri authored and ararslan committed Feb 15, 2019
1 parent b46dadc commit 96aecb4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/basicfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ end
@test log1pexp(-2.0) log(1.0 + exp(-2.0))
@test log1pexp(10000) 10000.0
@test log1pexp(-10000) 0.0

@test log1pexp(2f0) log(1f0 + exp(2f0))
@test log1pexp(-2f0) log(1f0 + exp(-2f0))
@test log1pexp(10000f0) 10000f0
@test log1pexp(-10000f0) 0f0
end

@testset "log1mexp" begin
Expand All @@ -43,6 +48,10 @@ end
@test logexpm1(2.0) log(exp(2.0) - 1.0)
@test logexpm1(log1pexp(2.0)) 2.0
@test logexpm1(log1pexp(-2.0)) -2.0

@test logexpm1(2f0) log(exp(2f0) - 1f0)
@test logexpm1(log1pexp(2f0)) 2f0
@test logexpm1(log1pexp(-2f0)) -2f0
end

@testset "log1pmx" begin
Expand Down

0 comments on commit 96aecb4

Please sign in to comment.