Basic Data Types

Numeric

Numeric data is what it sounds like, values that represent a number

Numbers

Numbers are the base case for numerical values, with each subsequent type being a more specific / restricted version of the number class.

Integers

Integers are numbers that do not contain any decimal component. By default, integers can be arbitrarily large, but fixed width integers are also possible

The full list of integer types includes

TypeDescriptionRange
intArbitrary precision signed integer(-inf..inf)
int88-bit signed integer[-128..127]
int1616-bit signed integer[-32768..32767]
int3232-bit signed integer[-2147483648..2147483647]
int6464-bit signed integer[-9223372036854775808..9223372036854775807]
int128128-bit signed integer[-170141183460469231731687303715884105728­..170141183460469231731687303715884105727]
uintArbitrary precision unsigned integer[0..inf)
uint88-bit unsigned integer[0..255]
uint1616-bit unsigned integer[0..65535]
uint3232-bit unsigned integer[0..4294967295]
uint6464-bit unsigned integer[0..18446744073709551615]
uint128128-bit unsigned integer[0..340282366920938463463374607431768211455]

Custom Ranged Integers

You can create integer types with a custom range by specifying the range as part of the type annotation

TBD for behavior when value goes out of bounds. Perhaps result will be undefined, or there can be a type setting for wrap around

Fixed Point

Fixed point will be stored as two integers, digits and shift where the value is digits * 10^shift

TBD on the syntax for declaring a fixed point number. likely to be a function call e.g.

Rational

Rational numbers are stored as two integers, the numerator and the denominator, where the value is numerator / denominator

TBD on the syntax for declaring a rational number. likely to be a function call e.g.

Real

Real numbers are positive and negative numbers that can have a decimal component to them. The default real will be stored as a float64 i.e. a 64-bit floating point number, but other widths (and potentially arbitrary precision) are possible

Boolean

Standard true/false type

Complex

complex numbers

Quaternions

Quaternions

MISC.

Other datatypes (probably include on this page)

  • strings
  • symbolics
  • units
  • types
  • enums or tokens