Skip to main content

Data Types

Basic Data Types

In programming, data type is an important concept.

Variables can store data of different types, and different types can do different things.

Unv has the following data types built-in by default, in these categories:

  • Text Type:
    • string
  • Numeric Types:
    • int, float(= number), complex
  • Sequence Types:
    • array
  • Mapping Type:
    • map
  • Boolean Type:
    • boolean

Setting the Data Type

In Unv, the data type is set when you assign a value to a variable:

ExampleData Type
x = "Hello World"string
x = 20int
x = 20.5float
x = 1jcomplex
x = ["apple", "banana", "cherry"]array
x = {"name" : "John", "age" : 36}map
x = trueboolean
Supported Runtimes

Check is your flavour of Unv is supported.

**Complex numbers are not supported in JavaScript.**