-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Julia 1.0 Programming - Second Edition
By :
Julia offers support for integer numbers ranging from types Int8 to Int128, with 8 to 128 representing the number of bits used, and with unsigned variants with a U prefix, such as UInt8. The default type (which can also be used as Int) is Int32 or Int64, depending on the target machine architecture. The bit width is given by the Sys.WORD_SIZE variable. The number of bits used by the integer affects the maximum and minimum value this integer can have. The minimum and maximum values are given by the typemin() and typemax() functions, respectively; for example, typemax(Int16) returns 32767.
If you try to store a number larger than that allowed by typemax, overflow occurs. For example, note the following:
julia> typemax(Int)9223372036854775807 # might be different on 32 bit platformjulia> ans + 1-9223372036854775808
Overflow checking is not automatic, so an explicit check (for example, the result has the wrong sign) is needed when this can occur. Integers can also be written in binary...
Change the font size
Change margin width
Change background colour