]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/tests/libntp/lfptest.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / tests / libntp / lfptest.h
1 #ifndef NTP_TESTS_LFPTEST_H
2 #define NTP_TESTS_LFPTEST_H
3
4 #include "ntp_fp.h"
5
6 int IsEqual(const l_fp expected, const l_fp actual) {
7         if (L_ISEQU(&expected, &actual)) {
8                 return TRUE;
9         } else {
10                 //printf(" expected: ...");
11                 /*
12                 << " expected: " << lfptoa(&expected, FRACTION_PREC)
13                                 << " (" << expected.l_ui << "." << expected.l_uf << ")"
14                                 << " but was: " << lfptoa(&actual, FRACTION_PREC)
15                                 << " (" << actual.l_ui << "." << actual.l_uf << ")";
16                 */
17                 return FALSE;
18         }
19
20 }
21
22 static const int32 HALF = -2147483647L - 1L;
23 static const int32 HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005
24 static const int32 HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005
25 static const int32 QUARTER = 1073741824L;
26 static const int32 QUARTER_PROMILLE_APPRX = 1073742L;
27
28 #endif
29
30