From 45648b6f956607b859b77bdb82563df094aa2516 Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Fri, 1 Oct 2010 17:42:50 +0000 Subject: FreeBSD 7 does not have log2. --- src/dht/gnunet-service-dht.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dht/gnunet-service-dht.c') diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 52d51ecb9..66facaa53 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -2731,11 +2731,11 @@ converge_distance (const GNUNET_HashCode *target, return 1; } - /* Take the log (base 2) of the number of bits matching the other peer */ - exponent = log2(other_matching_bits); + /* Take the log (base e) of the number of bits matching the other peer */ + exponent = log(other_matching_bits); - /* Check if we would overflow; our largest possible value is 2^64 */ - if (exponent * calc_value >= 64) + /* Check if we would overflow; our largest possible value is 2^64 = e^44.361419555836498 */ + if (exponent * calc_value >= 44.361419555836498) return ULLONG_MAX; /* Clear errno and all math exceptions */ -- cgit v1.2.3