fennec
Loading...
Searching...
No Matches
float.h
Go to the documentation of this file.
1// =====================================================================================================================
2// fennec, a free and open source game engine
3// Copyright © 2025 Medusa Slockbower
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17// =====================================================================================================================
18
29
30#ifndef FENNEC_LANG_FLOAT_H
31#define FENNEC_LANG_FLOAT_H
32
33#include <fennec/lang/bits.h>
34
35#undef FLT_HAS_INFINITY
36#undef FLT_HAS_QUIET_NAN
37#undef FLT_HAS_SIGNALING_NAN
38#undef FLT_HAS_DENORM
39#undef FLT_HAS_DENORM_LOSS
40#undef FLT_ROUNDS
41#undef FLT_IS_IEC559
42#undef FLT_MANT_DIG
43#undef FLT_DIG
44#undef FLT_DECIMAL_DIG
45#undef FLT_RADIX
46#undef FLT_MIN_EXP
47#undef FLT_MAX_EXP
48#undef FLT_MIN_10_EXP
49#undef FLT_MAX_10_EXP
50#undef FLT_TRAPS
51#undef FLT_TINYNESS_BEFORE
52#undef FLT_MIN
53#undef FLT_MAX
54#undef FLT_EPSILON
55#undef FLT_INF
56#undef FLT_QUIET_NAN
57#undef FLT_SIGNALING_NAN
58#undef FLT_DENORM_MIN
59#undef FLT_ROUND_ERR
60
61#define FLT_HAS_INFINITY 1
62#define FLT_HAS_QUIET_NAN 1
63#define FLT_HAS_SIGNALING_NAN 1
64#define FLT_HAS_DENORM 1
65#define FLT_HAS_DENORM_LOSS 0
66#define FLT_ROUNDS 1
67#define FLT_IS_IEC559 1
68#define FLT_MANT_DIG 24
69#define FLT_DIG 6
70#define FLT_DECIMAL_DIG 9
71#define FLT_RADIX 2
72#define FLT_MIN_EXP -125
73#define FLT_MAX_EXP 128
74#define FLT_MIN_10_EXP -37
75#define FLT_MAX_10_EXP 38
76#define FLT_TRAPS 0
77#define FLT_TINYNESS_BEFORE 0
78#define FLT_MIN fennec::bit_cast<float>(0x800000)
79#define FLT_MAX fennec::bit_cast<float>(0x7f7fffff)
80#define FLT_EPSILON fennec::bit_cast<float>(0x34000000)
81#define FLT_INF fennec::bit_cast<float>(0x7f800000)
82#define FLT_QUIET_NAN fennec::bit_cast<float>(0x7fc00000)
83#define FLT_SIGNALING_NAN fennec::bit_cast<float>(0x7fa00000)
84#define FLT_DENORM_MIN fennec::bit_cast<float>(0x1)
85#define FLT_ROUND_ERR fennec::bit_cast<float>(0x3f000000)
86
87#undef DBL_HAS_INFINITY
88#undef DBL_HAS_QUIET_NAN
89#undef DBL_HAS_SIGNALING_NAN
90#undef DBL_HAS_DENORM
91#undef DBL_HAS_DENORM_LOSS
92#undef DBL_ROUNDS
93#undef DBL_IS_IEC559
94#undef DBL_MANT_DIG
95#undef DBL_DIG
96#undef DBL_DECIMAL_DIG
97#undef DBL_RADIX
98#undef DBL_MIN_EXP
99#undef DBL_MAX_EXP
100#undef DBL_MIN_10_EXP
101#undef DBL_MAX_10_EXP
102#undef DBL_TRAPS
103#undef DBL_TINYNESS_BEFORE
104#undef DBL_MIN
105#undef DBL_MAX
106#undef DBL_EPSILON
107#undef DBL_INF
108#undef DBL_QUIET_NAN
109#undef DBL_SIGNALING_NAN
110#undef DBL_DENORM_MIN
111#undef DBL_ROUND_ERR
112
113#define DBL_HAS_INFINITY 1
114#define DBL_HAS_QUIET_NAN 1
115#define DBL_HAS_SIGNALING_NAN 1
116#define DBL_HAS_DENORM 1
117#define DBL_HAS_DENORM_LOSS 0
118#define DBL_ROUNDS 1
119#define DBL_IS_IEC559 1
120#define DBL_MANT_DIG 53
121#define DBL_DIG 15
122#define DBL_DECIMAL_DIG 17
123#define DBL_RADIX 2
124#define DBL_MIN_EXP -1021
125#define DBL_MAX_EXP 1024
126#define DBL_MIN_10_EXP -307
127#define DBL_MAX_10_EXP 308
128#define DBL_TRAPS 0
129#define DBL_TINYNESS_BEFORE 0
130#define DBL_MIN fennec::bit_cast<double>(0x10000000000000ll)
131#define DBL_MAX fennec::bit_cast<double>(0x7fefffffffffffffll)
132#define DBL_EPSILON fennec::bit_cast<double>(0x3cb0000000000000ll)
133#define DBL_INF fennec::bit_cast<double>(0x7ff0000000000000ll)
134#define DBL_QUIET_NAN fennec::bit_cast<double>(0x7ff8000000000000ll)
135#define DBL_SIGNALING_NAN fennec::bit_cast<double>(0x7ff4000000000000ll)
136#define DBL_DENORM_MIN fennec::bit_cast<double>(0x1ll)
137#define DBL_ROUND_ERR fennec::bit_cast<double>(0x3fe0000000000000ll)
138
139#endif // FENNEC_LANG_FLOAT_H
Bit Manipulation