From 7e6cfd0adfede02cba7666fe695fae23f857b59a Mon Sep 17 00:00:00 2001 From: cossio <j.cossio.diaz@gmail.com> Date: Wed, 9 Mar 2022 02:24:46 +0100 Subject: [PATCH] test log1pexp with multiple precisions --- test/basicfuns.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/basicfuns.jl b/test/basicfuns.jl index 8588bc36..ffddf36a 100644 --- a/test/basicfuns.jl +++ b/test/basicfuns.jl @@ -134,6 +134,15 @@ end @testset "log1pexp($x::$T)" for T in (Float16, Float32, Float64, BigFloat), x in -300:300 @test (@inferred log1pexp(T(x))) ≈ T(correct_log1pexp(big(x))) end + + # test BigFloat with multiple precisions + @testset "log1pexp($x) prec=$prec" for prec in (10, 20, 50, 100), x in -300:300 + expected = correct_log1pexp(big(x)) + setprecision(prec) do + actual = @inferred log1pexp(big(float(x))) + @test actual ≈ expected + end + end end @testset "log1mexp" begin