(int val) val: any type returns an int
Converts its argument to an integer.
If the argument is already an integer, it's returned.
If the argument is a floating-point number, the float is rounded towards zero. Values outside the representable range for a 32-bit signed integer are saturated (they return
int's maximum or minimum value).
If the argument is a character, returns its Unicode scalar value. This value can be passed to the
charfunction to losslessly convert it back to a character.
If the argument is a boolean, returns
Any other argument is an error.