Permalink
Browse files

Float16: dial back on conversions from Float16.

  • Loading branch information...
1 parent 8cc3a87 commit 74680b6c516402e677dbd1e47ed629acd6a5f5d3 @StefanKarpinski StefanKarpinski committed Feb 24, 2014
Showing with 1 addition and 4 deletions.
  1. +1 −4 base/float16.jl
View
@@ -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)))

0 comments on commit 74680b6

Please sign in to comment.