Wheefun I/O Library  0.0.5
Useful I/O Primitives.
float.h
Go to the documentation of this file.
1 /* WFIO - the Wheefun IO Library
2  Copyright (C) 2018 Phillip Kilgore
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program 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
12  GNU 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, see <https://www.gnu.org/licenses/>.
16 
17  Additionally, you should have recieved a copy of the GNU Classpath
18  exception, which amends the license to generally permit linking against
19  the software provided herein.
20 */
21 
33 #ifndef WFIO_FLOAT_H
34 #define WFIO_FLOAT_H
35 
36 #include <wfio/misctype.h>
37 #include <wfcnfo/float.h>
38 
40 
41 /* Floating point */
42 
55 #ifndef WFIO_HAVE_FLT16
56 #include <wfio/limits.h>
57 #if WFIO_FLOAT_BITS == 16
58 typedef float wfio_flt16_t;
59 #define WFIO_HAVE_FLT16
60 #elif WFIO_DOUBLE_BITS == 16
61 typedef double wfio_flt16_t;
62 #define WFIO_HAVE_FLT16
63 #elif WFIO_LODOUBLE_BITS == 16
64 typedef long double wfio_flt16_t;
65 #define WFIO_HAVE_FLT16
66 #else
68 #endif
69 #endif
70 
85 #ifndef WFIO_HAVE_FLT32
86 #include <wfio/limits.h>
87 #if WFIO_FLOAT_BITS==32
88 typedef float wfio_flt32_t;
89 #define WFIO_HAVE_FLT32
90 #elif WFIO_DOUBLE_BITS==32
91 typedef double wfio_flt32_t;
92 #define WFIO_HAVE_FLT32
93 #elif WFIO_LODOUBLE_BITS==32
94 typedef long double wfio_flt32_t;
95 #define WFIO_HAVE_FLT32
96 #else
98 #endif
99 #endif
100 
115 #ifndef WFIO_HAVE_FLT64
116 #include <wfio/limits.h>
117 #if WFIO_FLOAT_BITS == 64
118 typedef float wfio_flt64_t;
119 #define WFIO_HAVE_FLT64
120 #elif WFIO_DOUBLE_BITS == 64
121 typedef double wfio_flt64_t;
122 #define WFIO_HAVE_FLT64
123 #elif WFIO_LDOUBLE_BITS == 64
124 typedef long double wfio_flt64_t;
125 #define WFIO_HAVE_FLT64
126 #else
128 #endif
129 #endif
130 
131 #endif
132 
#define WFIO_C_BEGIN
Definition: host.h:477
Integral type definitions.
wfio_undefined_t wfio_flt32_t
A type corresponding to a 32-bit floating point number.
Definition: float.h:97
#define WFIO_C_END
Definition: host.h:485
Type limits.
wfio_undefined_t wfio_flt64_t
A type corresponding to a 64-bit floating point number.
Definition: float.h:127
A structure indicating no definition.
Definition: misctype.h:47