Suppose you want to be a to be the number
1 as a
Uint8. In a computer of 64bits, you automatic get for a an
Int64.
julia> a = 1
1
julia> typeof(a)
Int64
and If you want to use
:: in order to obtain an
Uint8, you only get type assertion
julia> a = 1::Uint8
type error: typeassert: expected Uint8, got Int64
julia> a::Uint8 = 1
a not defined
The only way I found is explicit convert to
Uint8julia> a = convert(Uint8,1)
0x01
Is there another way to do it?
Is there an analog for C's declaration of variables [
int a=1; ] ?