Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Float16: dial back on conversions from Float16.

  • Loading branch information...
commit 74680b6c516402e677dbd1e47ed629acd6a5f5d3 1 parent 8cc3a87
@StefanKarpinski StefanKarpinski authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 base/float16.jl
View
5 base/float16.jl
@@ -96,10 +96,7 @@ function convert(::Type{Float16}, val::Float32)
reinterpret(Float16, h)
end
-for T in (Bool, Int128, Uint128, Complex, Rational)
- @eval convert(::Type{$T}, x::Float16) = convert($T,float32(x))
-end
-convert{T<:Number}(::Type{T}, x::Float16) = convert(T,float32(x))
+convert(::Type{Integer}, x::Float16) = convert(Int,float32(x))
round(x::Float16) = float16(round(float32(x)))
trunc(x::Float16) = float16(trunc(float32(x)))
Please sign in to comment.
Something went wrong with that request. Please try again.