November 2017
Beginner
316 pages
6h 40m
English
The Bool type is used to denote the values of the Boolean type true and false:
julia> typeof(true)Bool
A quick way to find out the data type we are working with is the isa() function. On checking the original documentation, we see the following:
isa(x, type) -> Bool Determine whether x is of the given type.
This is almost the same functionality provided by the isinstance() function in Python, which also checks for data type and returns a Boolean value. Practically, it's as simple as the following command:
julia> isa(5, Int64)truejulia> isa(5.5, Float64)truejulia> isa(5.5, UInt64)false
Read now
Unlock full access