diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-07-09 16:54:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-12 11:33:48 -0500 |
commit | 1f7ba115a46743ea09402a30a7b11e4b6d2ee52e (patch) | |
tree | dcbefd24ee447826411d433d3ca3e2eca1d938fe /src/common/util.c | |
parent | 0694263b7533ba000d3d95a2936115b21b806a5d (diff) | |
download | tor-1f7ba115a46743ea09402a30a7b11e4b6d2ee52e.tar.gz tor-1f7ba115a46743ea09402a30a7b11e4b6d2ee52e.zip |
Rename cast_double_to_int64 to clamp_double_to_int64
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c index 63bd1cc6f3..f642c6a6dd 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -565,7 +565,7 @@ sample_laplace_distribution(double mu, double b, double p) result = mu - b * (p > 0.5 ? 1.0 : -1.0) * tor_mathlog(1.0 - 2.0 * fabs(p - 0.5)); - return cast_double_to_int64(result); + return clamp_double_to_int64(result); } /** Add random noise between INT64_MIN and INT64_MAX coming from a Laplace @@ -5509,7 +5509,7 @@ tor_weak_random_range(tor_weak_rng_t *rng, int32_t top) /** Cast a given double value to a int64_t. Return 0 if number is NaN. * Returns either INT64_MIN or INT64_MAX if number is outside of the int64_t * range. */ -int64_t cast_double_to_int64(double number) +int64_t clamp_double_to_int64(double number) { int exp; |