aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2010-10-01 17:42:50 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2010-10-01 17:42:50 +0000
commit45648b6f956607b859b77bdb82563df094aa2516 (patch)
tree985d8f16ffca6ae0ef907be886a055bd86fb8e29 /src/dht/gnunet-service-dht.c
parentca408b65a8a32ad47a7cf9e8347ac9b60b738573 (diff)
downloadgnunet-45648b6f956607b859b77bdb82563df094aa2516.tar.gz
gnunet-45648b6f956607b859b77bdb82563df094aa2516.zip
FreeBSD 7 does not have log2.
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r--src/dht/gnunet-service-dht.c8
1 files changed, 4 insertions, 4 deletions
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,
2731 return 1; 2731 return 1;
2732 } 2732 }
2733 2733
2734 /* Take the log (base 2) of the number of bits matching the other peer */ 2734 /* Take the log (base e) of the number of bits matching the other peer */
2735 exponent = log2(other_matching_bits); 2735 exponent = log(other_matching_bits);
2736 2736
2737 /* Check if we would overflow; our largest possible value is 2^64 */ 2737 /* Check if we would overflow; our largest possible value is 2^64 = e^44.361419555836498 */
2738 if (exponent * calc_value >= 64) 2738 if (exponent * calc_value >= 44.361419555836498)
2739 return ULLONG_MAX; 2739 return ULLONG_MAX;
2740 2740
2741 /* Clear errno and all math exceptions */ 2741 /* Clear errno and all math exceptions */