Skip to content

Commit

Permalink
Merge pull request #5916 from amitmurthy/amitm/f16
Browse files Browse the repository at this point in the history
make float16 serializable/deserializable
  • Loading branch information
JeffBezanson committed Feb 23, 2014
2 parents 16f5fd9 + 3d85ccd commit 46fa6ea
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function read{T <: Integer}(s::IO, ::Type{T})
end

read(s::IO, ::Type{Bool}) = (read(s,Uint8)!=0)
read(s::IO, ::Type{Float16}) = box(Float16,unbox(Int16,read(s,Int16)))
read(s::IO, ::Type{Float32}) = box(Float32,unbox(Int32,read(s,Int32)))
read(s::IO, ::Type{Float64}) = box(Float64,unbox(Int64,read(s,Int64)))

Expand Down

0 comments on commit 46fa6ea

Please sign in to comment.