Skip to content
Permalink
Browse files

[Bug 2382] Implement LOGTOD using ldexp() instead of shifting

  • Loading branch information...
Unknown committed Apr 24, 2013
1 parent b367860 commit 5f295cd05c3c136d39f5b3e500a2d781bdbb59c8
Showing with 3 additions and 3 deletions.
  1. +1 −0 ChangeLog
  2. +2 −3 include/ntp.h
@@ -1,4 +1,5 @@
* [Bug 1485] Sometimes ntpd crashes
* [Bug 2382] Implement LOGTOD using ldexp() instead of shifting.
(4.2.7p366) 2013/04/17 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1866] Disable some debugging output in refclock_oncore.
(4.2.7p365) 2013/04/16 Released by Harlan Stenn <stenn@ntp.org>
@@ -156,10 +156,9 @@ typedef char s_char;
#define SQUARE(x) ((x) * (x))
#define SQRT(x) (sqrt(x))
#define DIFF(x, y) (SQUARE((x) - (y)))
#define LOGTOD(a) ((a) < 0 ? 1. / (1L << -(a)) : \
1L << (int)(a)) /* log2 to double */
#define LOGTOD(a) ldexp(1., (int)(a)) /* log2 to double */
#define UNIVAR(x) (SQUARE(.28867513 * LOGTOD(x))) /* std uniform distr */
#define ULOGTOD(a) (1L << (int)(a)) /* ulog2 to double */
#define ULOGTOD(a) ldexp(1., (int)(a)) /* ulog2 to double */

#define EVENT_TIMEOUT 0 /* one second, that is */

0 comments on commit 5f295cd

Please sign in to comment.
You can’t perform that action at this time.