-
Notifications
You must be signed in to change notification settings - Fork 2
Data Types
Pranav Verma edited this page Dec 3, 2024
·
6 revisions
Tidal Currently Supports the Following Data Types:
Integers are Defined as Follows:
var a = 10;
novar b = 20;
Strings are Defined as Follows:
var a = "hello";
novar b = "hi";
Null Variables are Defined as Follows:
var a;
var b = null;
novar b;
Float can store Decimals.
var a = 12.34;
var b = 0.0;
Arrays work like Lists in Python.
var a = [12, ["hi", 12], "98"];
Tidal Supports Dynamic Type Casting, for variables.
Anything inside int()
will be converted to a integer
data type.
Anything inside str()
will be converted to a string
data type.
Anything inside bool()
will be converted to a bool
data type.
Anything inside float()
will be converted to a float
data type.
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 {}
Blue Lagoon.
A Pranav Verma Production.