Version: 1.1.0
Types and literals cheat sheet
How to write numbers, vectors, and text.
Essentials
42is an integer literal.42.0is a float literal.IntandFloat64are the default stored types.SIMD[DType.float32, 4]is four 32-bit floats.- Strings use double quotes. Adjacent string literals concatenate.
NoneandOptionalare different ideas.Nonefills an optional.
Example
def main():
var v = SIMD[DType.float32, 4](1, 2, 3, 4)
print(v[0])
Keep in mind
Do not store a wide literal into a narrow dtype without deciding the rounding.