1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
The `int()` function converts the given value into a signed integer
value and returns the resulting number.
Returns `NaN` if the given argument is not convertible into a number.
Returns `NaN` if the conversion result is out of range.
-- Testcase --
{%
printf("%.J\n", [
int(),
int(false),
int(123),
int(456.789),
int(""),
int("invalid"),
int("deaf"),
int("0x1000"),
int("0xffffffffffffffff"),
int("0177"),
int("+145"),
int("-96")
]);
%}
-- End --
-- Expect stdout --
[
0,
0,
123,
456,
"NaN",
"NaN",
"NaN",
0,
0,
177,
145,
-96
]
-- End --
|