type
Syntax
type(X)
Details
Return an integer indicating the data type of X. Please refer to Data Types for details.
Parameters
X can be any data type that the system supports.
Returns
A scalar of type INT.
Examples
x=3;
x;
// output: 3
type(x);
// output: 4
// INT
type(1.2);
// output: 16
// DOUBLE
type("Hello");
// output: 18
// STRING
// type values for columnar tuples
a = array(ANY[INT], 0, 10)
a.append!([1, 2, 3])
type(a)
// output: 132
// 132 = 4 (INT) + 128
b = array(ANY[DOUBLE], 0, 10)
b.append!([1.0, 2.0])
type(b)
// output: 144
c = array(ANY[DECIMAL32(2)], 0, 10)
type(c)
// output: 165
// Comparison with regular tuples
d = (1, "hello", 2.5)
type(d)
// output: 25
