[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13112 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13112 - gnunet/src/dht |
Date: |
Fri, 1 Oct 2010 19:42:50 +0200 |
Author: amatus
Date: 2010-10-01 19:42:50 +0200 (Fri, 01 Oct 2010)
New Revision: 13112
Modified:
gnunet/src/dht/gnunet-service-dht.c
Log:
FreeBSD 7 does not have log2.
Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-10-01 15:42:14 UTC (rev 13111)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-10-01 17:42:50 UTC (rev 13112)
@@ -2731,11 +2731,11 @@
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 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13112 - gnunet/src/dht,
gnunet <=