@@ -48,6 +48,8 @@ template <> struct FXRep<short fract> {
48
48
LIBC_INLINE static constexpr Type MAX () { return SFRACT_MIN; }
49
49
LIBC_INLINE static constexpr Type ZERO () { return 0 .0HR; }
50
50
LIBC_INLINE static constexpr Type EPS () { return SFRACT_EPSILON; }
51
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5HR; }
52
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25HR; }
51
53
52
54
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
53
55
using CompType = cpp::make_signed_t <StorageType>;
@@ -66,6 +68,8 @@ template <> struct FXRep<unsigned short fract> {
66
68
LIBC_INLINE static constexpr Type MAX () { return USFRACT_MIN; }
67
69
LIBC_INLINE static constexpr Type ZERO () { return 0 .0UHR; }
68
70
LIBC_INLINE static constexpr Type EPS () { return USFRACT_EPSILON; }
71
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5UHR; }
72
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25UHR; }
69
73
70
74
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
71
75
using CompType = cpp::make_unsigned_t <StorageType>;
@@ -84,6 +88,8 @@ template <> struct FXRep<fract> {
84
88
LIBC_INLINE static constexpr Type MAX () { return FRACT_MIN; }
85
89
LIBC_INLINE static constexpr Type ZERO () { return 0 .0R; }
86
90
LIBC_INLINE static constexpr Type EPS () { return FRACT_EPSILON; }
91
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5R; }
92
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25R; }
87
93
88
94
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
89
95
using CompType = cpp::make_signed_t <StorageType>;
@@ -102,6 +108,8 @@ template <> struct FXRep<unsigned fract> {
102
108
LIBC_INLINE static constexpr Type MAX () { return UFRACT_MIN; }
103
109
LIBC_INLINE static constexpr Type ZERO () { return 0 .0UR; }
104
110
LIBC_INLINE static constexpr Type EPS () { return UFRACT_EPSILON; }
111
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5UR; }
112
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25UR; }
105
113
106
114
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
107
115
using CompType = cpp::make_unsigned_t <StorageType>;
@@ -120,6 +128,8 @@ template <> struct FXRep<long fract> {
120
128
LIBC_INLINE static constexpr Type MAX () { return LFRACT_MIN; }
121
129
LIBC_INLINE static constexpr Type ZERO () { return 0 .0LR; }
122
130
LIBC_INLINE static constexpr Type EPS () { return LFRACT_EPSILON; }
131
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5LR; }
132
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25LR; }
123
133
124
134
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
125
135
using CompType = cpp::make_signed_t <StorageType>;
@@ -138,6 +148,8 @@ template <> struct FXRep<unsigned long fract> {
138
148
LIBC_INLINE static constexpr Type MAX () { return ULFRACT_MIN; }
139
149
LIBC_INLINE static constexpr Type ZERO () { return 0 .0ULR; }
140
150
LIBC_INLINE static constexpr Type EPS () { return ULFRACT_EPSILON; }
151
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5ULR; }
152
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25ULR; }
141
153
142
154
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
143
155
using CompType = cpp::make_unsigned_t <StorageType>;
@@ -156,6 +168,8 @@ template <> struct FXRep<short accum> {
156
168
LIBC_INLINE static constexpr Type MAX () { return SACCUM_MIN; }
157
169
LIBC_INLINE static constexpr Type ZERO () { return 0 .0HK; }
158
170
LIBC_INLINE static constexpr Type EPS () { return SACCUM_EPSILON; }
171
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5HK; }
172
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25HK; }
159
173
160
174
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
161
175
using CompType = cpp::make_signed_t <StorageType>;
@@ -174,6 +188,8 @@ template <> struct FXRep<unsigned short accum> {
174
188
LIBC_INLINE static constexpr Type MAX () { return USACCUM_MIN; }
175
189
LIBC_INLINE static constexpr Type ZERO () { return 0 .0UHK; }
176
190
LIBC_INLINE static constexpr Type EPS () { return USACCUM_EPSILON; }
191
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5UHK; }
192
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25UHK; }
177
193
178
194
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
179
195
using CompType = cpp::make_unsigned_t <StorageType>;
@@ -192,6 +208,8 @@ template <> struct FXRep<accum> {
192
208
LIBC_INLINE static constexpr Type MAX () { return ACCUM_MIN; }
193
209
LIBC_INLINE static constexpr Type ZERO () { return 0 .0K; }
194
210
LIBC_INLINE static constexpr Type EPS () { return ACCUM_EPSILON; }
211
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5K; }
212
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25K; }
195
213
196
214
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
197
215
using CompType = cpp::make_signed_t <StorageType>;
@@ -210,6 +228,8 @@ template <> struct FXRep<unsigned accum> {
210
228
LIBC_INLINE static constexpr Type MAX () { return UACCUM_MIN; }
211
229
LIBC_INLINE static constexpr Type ZERO () { return 0 .0UK; }
212
230
LIBC_INLINE static constexpr Type EPS () { return UACCUM_EPSILON; }
231
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5UK; }
232
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25UK; }
213
233
214
234
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
215
235
using CompType = cpp::make_unsigned_t <StorageType>;
@@ -228,6 +248,8 @@ template <> struct FXRep<long accum> {
228
248
LIBC_INLINE static constexpr Type MAX () { return LACCUM_MIN; }
229
249
LIBC_INLINE static constexpr Type ZERO () { return 0 .0LK; }
230
250
LIBC_INLINE static constexpr Type EPS () { return LACCUM_EPSILON; }
251
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5LK; }
252
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25LK; }
231
253
232
254
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
233
255
using CompType = cpp::make_signed_t <StorageType>;
@@ -246,6 +268,8 @@ template <> struct FXRep<unsigned long accum> {
246
268
LIBC_INLINE static constexpr Type MAX () { return ULACCUM_MIN; }
247
269
LIBC_INLINE static constexpr Type ZERO () { return 0 .0ULK; }
248
270
LIBC_INLINE static constexpr Type EPS () { return ULACCUM_EPSILON; }
271
+ LIBC_INLINE static constexpr Type ONE_HALF () { return 0 .5ULK; }
272
+ LIBC_INLINE static constexpr Type ONE_FOURTH () { return 0 .25ULK; }
249
273
250
274
using StorageType = typename internal::Storage<TOTAL_LEN>::Type;
251
275
using CompType = cpp::make_unsigned_t <StorageType>;
0 commit comments