Maybe this is expected, but it was a bit of a surprise to me:
julia> function foo()
red::Uint8 = 0x33
blue::Uint8 = 0x36
(red-blue)
end
julia> foo()
0xfffffffffffffffd
julia> typeof(foo())
Uint64
The fact that it overflowed wasn't surprising, but the fact that it got
converted to a Uint64 is a bit surprising (it ended up being a very large
number that got used in other calculations later which led to odd results)
. So it looks like all of the math operators will always promote to the
largest size (but keep the same signed or unsignedness).
I'm wondering if it might make more sense if:
Uint8 - Uint8 -> Uint8
Or more generally: UintN <op> UintN -> UintN ?
and: IntN <op> IntN -> IntN