Skip to content

Commit

Permalink
Fix bug in several Float16 methods where the second positional argume…
Browse files Browse the repository at this point in the history
…nt wasn't used.

Add test based on original issue #17148.
  • Loading branch information
pkofod committed Jun 27, 2016
1 parent 861100c commit 22a4d8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/float16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions test/float16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 22a4d8b

Please sign in to comment.