Skip to content

readdlm casts (un)signed integers to floats  #8

@jakebolewski

Description

@jakebolewski
julia> io = IOBuffer("0x0\n0x1\n0x2")
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=11, maxsize=Inf, ptr=1, mark=-1)

julia> readdlm(io)
3×1 Array{Float64,2}:
 0.0
 1.0
 2.0

julia> io = IOBuffer("0\n1\n2")
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=5, maxsize=Inf, ptr=1, mark=-1)

julia> readdlm(io)
3×1 Array{Float64,2}:
 0.0
 1.0
 2.0

julia> io = IOBuffer("foo\n1\n2")
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=7, maxsize=Inf, ptr=1, mark=-1)

julia> readdlm(io)
3×1 Array{Any,2}:
  "foo"
 1
 2

julia> io = IOBuffer("foo\n0x1\n0x2")
IOBuffer(data=UInt8[...], readable=true, writable=false, seekable=true, append=false, size=11, maxsize=Inf, ptr=1, mark=-1)

julia> readdlm(io)
3×1 Array{Any,2}:
  "foo"
 1
 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions