short

Syntax

short(X)

Arguments

x can be of any data type.

Details

Convert the input to the data type of SHORT.

Examples

x=short();
x;
// output: 00h

typestr x;
// output: SHORT

short(`12.3);
// output: 12

short(`120.9c);
// output: 120

short(32767);
// output: 32767
Note:

The range of SHORT is [ -215+1, 215 -1] = [-32767, 32767]. If X exceeds this range, an overflow will occur.

short(32768);
//output: null

short(65578);
//output: 42

short(32789)
//output: -32747