June 2019
Intermediate to advanced
218 pages
5h 19m
English
The basic integers described previously are all signed values, in that numbers greater and less than zero are stored separately. Unsigned integers can be stored using the UInt64 and UInt32 types. As with many other Julia types, the type conversions can be done via constructors, as follows:
julia> UInt64(1)0x0000000000000001
These conversions check for out-of-range values. They throw an error when trying to convert a value that does not fit in the resulting type, as follows:
julia> UInt32(4294967297)ERROR: InexactError: trunc(UInt32, 4294967297)Stacktrace:....
The conditional check will have ...
Read now
Unlock full access