Skip to content

Data Types

Pranav Verma edited this page Dec 3, 2024 · 6 revisions

Tidal Currently Supports the Following Data Types:

Integer

Integers are Defined as Follows:

var a = 10;
novar b = 20;

Strings

Strings are Defined as Follows:

var a = "hello";
novar b = "hi";

Null

Null Variables are Defined as Follows:

var a;
var b = null;
novar b;

Float

Float can store Decimals.

var a = 12.34;
var b = 0.0;

Array

Arrays work like Lists in Python.

var a = [12, ["hi", 12], "98"];

Type Casting

Tidal Supports Dynamic Type Casting, for variables.

int()

Anything inside int() will be converted to a integer data type.

str()

Anything inside str() will be converted to a string data type.

bool()

Anything inside bool() will be converted to a bool data type.

float()

Anything inside float() will be converted to a float data type.

Type Comparison

In Tidal, you can compare between two types like this:

var a = 0;

if (type(a) == int) {
     /* Code to Run Here */
} elif (type(a) == float) {
     /* Code to Run Here */
} elif (type(a) == bool) {
     /* Code to Run Here */
} elif (type(a) == str) {
     /* Code to Run Here */
} elif (type(a) == int) {
     /* Code to Run Here */
} else {}
Clone this wiki locally