Add an util function to cast double to int64_t
commit8acccdbeac69b066be805f711133e188a7b04f28
authorDavid Goulet <dgoulet@ev0ke.net>
Mon, 16 Feb 2015 20:55:30 +0000 (16 15:55 -0500)
committerteor <teor2345@gmail.com>
Wed, 6 May 2015 08:05:16 +0000 (6 18:05 +1000)
tree1d7e685781506b75946d6cdd1f4f61da2580deef
parentdad5eb7e1f3c92974c7bcaaea325a05233a27494
Add an util function to cast double to int64_t

Use it in the sample_laplace_distribution function to make sure we return
the correct converted value after math operations are done on the input
values.

Thanks to Yawning for proposing a solution.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
src/common/util.c
src/common/util.h