s32()

Converts the given number to a signed 32-bit integer (`int32`) by rounding to the nearest whole number and typecasting.

If the number exceeds the range of an `int32` (-2,147,483,648 to 2,147,483,647), it will wrap due to typecasting.

Syntax

s32(value)

Parameters

Parameter Type Description
value Number Numeric value to convert to int32.

Return Value

Examples

s32(123456.7);       // returns 123457
s32(-2200000000);    // returns 194967296 (wraps)
s32(3000000000);     // returns -1294967296 (wrap)

See also

s8
u8
s16
u16
s32
u32