-
Notifications
You must be signed in to change notification settings - Fork 0
Primitive Literals
Primitive Literals (Primitives) are the most basic building blocks of XCSL. Primitives are automatically included for use in every XCSL source module. These include articles such as integers and strings.
- Integers
- Reals
- Booleans
- Characters & Strings
- Strings
Integers can be signed or unsigned. Signed integers can be positive or negative; unsigned integers can only be positive but range twice as high in value. It is considered best practice to use the smallest suitable integer size, because it will be the fastest in execution.
XCS offers Unsigned Integer values with the following ranges:
- 8-bit (u8): 0 -- 255 (2^8)
- 16-bit (u16): 0 -- 65,535 (2^16)
- 32-bit (u32): 0 -- 4,294,967,295 (2^32)
- 64-bit (u64): 0 -- 18,446,744,073,709,551,615 (2^64)
XCS offers Signed Integer values with the following ranges:
- 8-bit (i8): -128 -- 127
- 16-bit (i16): −32,768 -- 32,767
- 32-bit (i32): -2,147,483,648 -- 2,147,483,647
- 64-bit (i64): -9,223,372,036,854,775,808 -- 9,223,372,036,854,775,807
XCS offers two variations of Real Number values (e.g. numbers with decimal points):
- Single-Precision Floating Point (float): 7-8 digit precision
- Double-Precision Floating Point (double): 15-16 digit precision
XCS offers logical functionality in the form of Boolean values (True, False).