May 2019
Beginner to intermediate
466 pages
10h 44m
English
The convert function can also be used explicitly in the code as convert(Int64, 7.0), which returns 7.
In general, convert(Type, x) will attempt to put the x value in an instance of Type. In most cases, type(x) will also do the trick, as in Int64(7.0), returning 7.
The conversion, however, doesn't always work:
This last error message really shows us how multiple dispatch works; the types of the input arguments are matched against the methods ...
Read now
Unlock full access