Skip to content
Permalink
Browse files Browse the repository at this point in the history
[Bug 2382] Implement LOGTOD using ldexp() instead of shifting
  • Loading branch information
Unknown committed Apr 24, 2013
1 parent b367860 commit 5f295cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog
@@ -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>
Expand Down
5 changes: 2 additions & 3 deletions include/ntp.h
Expand Up @@ -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 */

Expand Down

0 comments on commit 5f295cd

Please sign in to comment.