Velo by Example: Values

Velo has several built-in value types including strings, integers, floats, booleans, and bytes.

Strings are declared with double quotes.

str greeting = "Hello";
str multiline = "Line 1\nLine 2";

Integers support decimal, hexadecimal, and binary notation.

int decimal = 42;
int hex = 0xCAFE;
int binary = 0b101010;

Floating-point numbers use the float type.

float pi = 3.14;
float e = 2.71828;

Booleans are true or false.

bool isTrue = true;
bool isFalse = false;

Bytes use the y suffix.

byte b = 65;
byte c = 2y;

The any type can hold values of any type.

any value = 42;
value = "Hello";
value = true;