From 22a4d8ba57df005887ec0832720d2f532038e796 Mon Sep 17 00:00:00 2001 From: Patrick Kofod Mogensen Date: Mon, 27 Jun 2016 20:45:52 +0200 Subject: [PATCH] Fix bug in several Float16 methods where the second positional argument wasn't used. Add test based on original issue #17148. --- base/float16.jl | 2 +- test/float16.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/float16.jl b/base/float16.jl index a58a36a4c7a85..46dcb8bfaa0d7 100644 --- a/base/float16.jl +++ b/base/float16.jl @@ -154,7 +154,7 @@ end for func in (:div,:fld,:cld,:rem,:mod,:atan2,:hypot) @eval begin - $func(a::Float16,b::Float16) = Float16($func(Float32(a),Float32(a))) + $func(a::Float16,b::Float16) = Float16($func(Float32(a),Float32(b))) end end diff --git a/test/float16.jl b/test/float16.jl index 22705ae9131a5..2031c056040b7 100644 --- a/test/float16.jl +++ b/test/float16.jl @@ -143,3 +143,6 @@ end # #9939 (and #9897) @test rationalize(Float16(0.1)) == 1//10 + +# issue #17148 +@test rem(Float16(1.2), Float16(one(1.2))) == 0.20019531f0