On Monday, December 8, 2014 10:21:52 AM UTC+10, Phil Tomson wrote:
>
> julia> typeof(-0b111)
> Uint64
>
> julia> typeof(-7)
> Int64
>
> julia> typeof(-0x7)
> Uint64
>
> julia> typeof(-7)
> Int64
>
> I find this a bit surprising. Why does the base of the number determine 
> signed or unsigned-ness? Is this intentional or possibly a bug?
>

This is documented behaviour 
http://docs.julialang.org/en/latest/manual/integers-and-floating-point-numbers/#integers
 
based on the heuristic that using hex is "mostly" in situations where you 
need unsigned behaviour anyway.

Cheers
Lex   

Reply via email to