Variables, naming conventions, and comments

Data is stored in values such as 1, 3.14, and "Julia", and every other value has a type, for example, the type of 3.14 is Float64. Some other examples of elementary values and their data types are 42 of the Int64 type, true and false of the Bool type, and 'X' of the Char type.

Julia, unlike many modern programming languages, differentiates between single characters and strings. Strings can contain any number of characters, and are specified using double quotes—single quotes are only used for a character literal. Variables are the names that are bound to values by assignments, such as x = 42. They have the type of the value they contain (or reference); this type is given by the typeof function. For ...

Get Julia 1.0 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.