mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
GH-1860: Add double_to_int() bif
This commit is contained in:
parent
f2b74d21f7
commit
7de9a7d76f
3 changed files with 29 additions and 0 deletions
|
@ -3,3 +3,7 @@
|
|||
-1
|
||||
4294967296
|
||||
0
|
||||
3
|
||||
4
|
||||
-3
|
||||
-4
|
||||
|
|
|
@ -8,4 +8,16 @@ event zeek_init()
|
|||
print to_int("-1");
|
||||
print to_int("4294967296");
|
||||
print to_int("not an int");
|
||||
|
||||
local a: double = 3.14;
|
||||
print double_to_int(a);
|
||||
|
||||
local b: double = 3.9;
|
||||
print double_to_int(b);
|
||||
|
||||
local c: double = -3.14;
|
||||
print double_to_int(c);
|
||||
|
||||
local d: double = -3.9;
|
||||
print double_to_int(d);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue