Fix to_json() to not lose precision for values of type double

Also changed a few values in the tests for better numerical diversity.
This commit is contained in:
Daniel Thayer 2017-02-02 13:03:05 -06:00
parent 65d6e5a4f7
commit 6812a7febe
3 changed files with 11 additions and 10 deletions

View file

@ -30,14 +30,14 @@ event bro_init()
local i: int = -999;
print to_json(i);
local d1: double = 1.123456789;
local d2: double = -1.123456e308;
local d3: double = 9.876543e-308;
local d1: double = 3.14;
local d2: double = -1.23456789e308;
local d3: double = 9e-308;
print to_json(d1);
print to_json(d2);
print to_json(d3);
local t: time = double_to_time(1.0);
local t: time = double_to_time(1480788576.868945);
print to_json(t);
local ti: interval = -12hr;