That is part of the inconsistency I was referring to. IMO a single
default representation for a value should be used everywhere.
Further, in 0.4rc1 there seems to be another, more serious
inconsistency: decimal is being printed for UInt column vectors and hex
for row vectors.
a = UInt[]
for n::UInt in 10:12
push!(a, n)
end
b = UInt[10 11 12]
c = UInt[10, 11, 12]
d = UInt[n for n in 10:12]
println(a)
println(b)
println(c)
println(d)
Output from CLI:
UInt64[0x000000000000000a,0x000000000000000b,0x000000000000000c]
UInt64[10 11 12]
UInt64[0x000000000000000a,0x000000000000000b,0x000000000000000c]
UInt64[0x000000000000000a,0x000000000000000b,0x000000000000000c]
I am pretty sure this is a bug.
On 09/17/2015 08:16 AM, Sisyphuss wrote:
> This is not "printing" but "returned value"
> Try `a[1]`, you get 0x0000000000000001
> Try `print(a[1])`, you get 1
>
> So overload `print` if ever needed.
>
>
> On Wednesday, September 16, 2015 at 11:34:33 PM UTC+2,
> [email protected] wrote:
>
> In Julia 0.4rc1, when I create a UInt, either as an individual
> value or array, and then print it hex values are usually displayed
> instead of decimals. I say 'usually' because the behavior changes
> a bit between REPL and
>
> For instance:
>
> |
> julia>a =UInt[1234]
> 1x4Array{UInt64,2}:
> 0x0000000000000001 0x0000000000000002 … 0x0000000000000004
> |
>
> This annoys me because 98% of the time I want the decimal
> representation. Decimal is shown for Int, so why is hex the
> default for UInt? Is it a bug?
>