(int val) val: any type returns an int
F
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).nan.0
returns0
. -
If the argument is a character, returns its Unicode scalar value. This value can be passed to the
char
function to losslessly convert it back to a character. -
If the argument is a boolean, returns
0
for#f
or1
for#t
. -
Any other argument is an error.