Change `SCM_GC_BYTEVECTOR' to `SCM_R6RS_GC_BYTEVECTOR'.
[guile-r6rs-libs.git] / src / ieee-754.h
blobae16cd9c8d08e6df66b4cc096c35c5a5929616a4
1 /* Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef GUILE_R6RS_IEEE_754_H
20 #define GUILE_R6RS_IEEE_754_H 1
22 /* Based on glibc's <ieee754.h> and modified by Ludovic Courtès to include
23 all possible IEEE-754 double-precision representations. */
26 /* IEEE 754 simple-precision format (32-bit). */
28 union scm_r6rs_ieee754_float
30 float f;
32 struct
34 unsigned int negative:1;
35 unsigned int exponent:8;
36 unsigned int mantissa:23;
37 } big_endian;
39 struct
41 unsigned int mantissa:23;
42 unsigned int exponent:8;
43 unsigned int negative:1;
44 } little_endian;
49 /* IEEE 754 double-precision format (64-bit). */
51 union scm_r6rs_ieee754_double
53 double d;
55 struct
57 /* Big endian. */
59 unsigned int negative:1;
60 unsigned int exponent:11;
61 /* Together these comprise the mantissa. */
62 unsigned int mantissa0:20;
63 unsigned int mantissa1:32;
64 } big_endian;
66 struct
68 /* Both byte order and word order are little endian. */
70 /* Together these comprise the mantissa. */
71 unsigned int mantissa1:32;
72 unsigned int mantissa0:20;
73 unsigned int exponent:11;
74 unsigned int negative:1;
75 } little_little_endian;
77 struct
79 /* Byte order is little endian but word order is big endian. Not
80 sure this is very wide spread. */
81 unsigned int mantissa0:20;
82 unsigned int exponent:11;
83 unsigned int negative:1;
84 unsigned int mantissa1:32;
85 } little_big_endian;
90 #endif /* ieee-754.h */