From 96aecb4b705594983cc4565ccbbdae957c21058a Mon Sep 17 00:00:00 2001 From: Takamasa Oshikiri Date: Sat, 16 Feb 2019 07:23:22 +0900 Subject: [PATCH] Add tests for float32 arguments (#68) --- test/basicfuns.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/basicfuns.jl b/test/basicfuns.jl index cf58654..02e00f4 100644 --- a/test/basicfuns.jl +++ b/test/basicfuns.jl @@ -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 @@ -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