Remove "Written by Ben Pfaff <blp@gnu.org>" lines everywhere.
[pspp-builds.git] / src / libpspp / magic.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3
4    This program is free software; you can redistribute it and/or
5    modify it under the terms of the GNU General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    License, or (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful, but
10    WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17    02110-1301, USA. */
18
19 #if !magic_h
20 #define magic_h 1
21
22 /* Magic numbers. */
23
24 #include <float.h>
25 #include <limits.h>
26
27 /* Check that the floating-point representation is one that we
28    understand. */
29 #ifndef FPREP_IEEE754
30 #error Only IEEE-754 floating point currently supported.
31 #endif
32
33 /* Allows us to specify individual bytes of a double. */     
34 union cvt_dbl {
35   unsigned char cvt_dbl_i[8];
36   double cvt_dbl_d;
37 };
38
39
40 /* "Second-lowest value" bytes for an IEEE-754 double. */
41 #if WORDS_BIGENDIAN
42 #define SECOND_LOWEST_BYTES {0xff,0xef,0xff,0xff, 0xff,0xff,0xff,0xfe}
43 #else
44 #define SECOND_LOWEST_BYTES {0xfe,0xff,0xff,0xff, 0xff,0xff,0xef,0xff}
45 #endif
46
47 /* "Second-lowest value" for a double. */
48 #if __GNUC__
49 #define second_lowest_value                                               \
50         (__extension__ ((union cvt_dbl) {SECOND_LOWEST_BYTES}).cvt_dbl_d)
51 #else /* not GNU C */
52 extern union cvt_dbl second_lowest_value_union;
53 #define second_lowest_value (second_lowest_value_union.cvt_dbl_d)
54 #endif
55
56 /* Used when we want a "missing value". */
57 #define NOT_DOUBLE (-DBL_MAX)
58 #define NOT_LONG LONG_MIN
59 #define NOT_INT INT_MIN
60
61 #endif /* magic.h */