Skip to content

Commit

Permalink
Merge pull request #17150 from pkofod/patch-2
Browse files Browse the repository at this point in the history
Fix bugs in definitions of several Float16 methods (ref #17148).
  • Loading branch information
simonbyrne authored Jun 27, 2016
2 parents 56f0127 + 22a4d8b commit d051cb5
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 d051cb5

Please sign in to comment.