Difference between revisions of "W1102 Types"
Line 27: | Line 27: | ||
let g0 = 9.80665 (in m/s2) | let g0 = 9.80665 (in m/s2) | ||
</pre> | </pre> | ||
Revision as of 16:51, 13 December 2021
Prerequisites[edit]
Data Types[edit]
Data types (or sometimes just types) provide a means to classify data so that the REPL or ECRD environment can properly interpret the data. A data type provides the connection between the binary format in which all data is ultimately represented in a digital computer (whether that be in main memory, a register, on disk, or in transit across a network) and the representation of that data for humans. Further, legal operations on the associated data is determined by its type. Let’s consider a few bytes in memory:
07AE: 0 1 0 0 0 0 0 1 07AF: 0 1 0 1 1 0 0 0
Coming Soon | |
Add section describing all basic types, including sized integers (Int8, etc.) and unsigned integers of various sizes. |
Constants[edit]
A constant is a value which will not be altered as a program executes. A named constant is a constant associated with an identifier which can subsequently be used to refer to the value of the constant. In the below examples, pi, e, and g0 are all named constants:
let pi = 3.14159265358979323846 let e = 2.718281828459 let g0 = 9.80665 (in m/s2)