@@ -42,6 +42,18 @@ public static class BinaryIntegerHelper<TSelf>
42
42
public static bool TryWriteBigEndian ( TSelf value , Span < byte > destination , out int bytesWritten ) => value . TryWriteBigEndian ( destination , out bytesWritten ) ;
43
43
44
44
public static bool TryWriteLittleEndian ( TSelf value , Span < byte > destination , out int bytesWritten ) => value . TryWriteLittleEndian ( destination , out bytesWritten ) ;
45
+
46
+ public static int WriteBigEndian ( TSelf value , byte [ ] destination ) => value . WriteBigEndian ( destination ) ;
47
+
48
+ public static int WriteBigEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteBigEndian ( destination , startIndex ) ;
49
+
50
+ public static int WriteBigEndian ( TSelf value , Span < byte > destination ) => value . WriteBigEndian ( destination ) ;
51
+
52
+ public static int WriteLittleEndian ( TSelf value , byte [ ] destination ) => value . WriteLittleEndian ( destination ) ;
53
+
54
+ public static int WriteLittleEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteLittleEndian ( destination , startIndex ) ;
55
+
56
+ public static int WriteLittleEndian ( TSelf value , Span < byte > destination ) => value . WriteLittleEndian ( destination ) ;
45
57
}
46
58
47
59
public static class BinaryNumberHelper < TSelf >
@@ -100,9 +112,39 @@ public static class EqualityOperatorsHelper<TSelf, TOther>
100
112
public static bool op_Inequality ( TSelf left , TOther right ) => left != right ;
101
113
}
102
114
115
+ public static class ExponentialFunctionsHelper < TSelf >
116
+ where TSelf : IExponentialFunctions < TSelf >
117
+ {
118
+ public static TSelf Exp ( TSelf x ) => TSelf . Exp ( x ) ;
119
+
120
+ public static TSelf ExpM1 ( TSelf x ) => TSelf . ExpM1 ( x ) ;
121
+
122
+ public static TSelf Exp2 ( TSelf x ) => TSelf . Exp2 ( x ) ;
123
+
124
+ public static TSelf Exp2M1 ( TSelf x ) => TSelf . Exp2M1 ( x ) ;
125
+
126
+ public static TSelf Exp10 ( TSelf x ) => TSelf . Exp10 ( x ) ;
127
+
128
+ public static TSelf Exp10M1 ( TSelf x ) => TSelf . Exp10M1 ( x ) ;
129
+ }
130
+
103
131
public static class FloatingPointHelper < TSelf >
104
132
where TSelf : IFloatingPoint < TSelf >
105
133
{
134
+ public static TSelf Ceiling ( TSelf x ) => TSelf . Ceiling ( x ) ;
135
+
136
+ public static TSelf Floor ( TSelf x ) => TSelf . Floor ( x ) ;
137
+
138
+ public static TSelf Round ( TSelf x ) => TSelf . Round ( x ) ;
139
+
140
+ public static TSelf Round ( TSelf x , int digits ) => TSelf . Round ( x , digits ) ;
141
+
142
+ public static TSelf Round ( TSelf x , MidpointRounding mode ) => TSelf . Round ( x , mode ) ;
143
+
144
+ public static TSelf Round ( TSelf x , int digits , MidpointRounding mode ) => TSelf . Round ( x , digits , mode ) ;
145
+
146
+ public static TSelf Truncate ( TSelf x ) => TSelf . Truncate ( x ) ;
147
+
106
148
public static int GetExponentByteCount ( TSelf value ) => value . GetExponentByteCount ( ) ;
107
149
108
150
public static int GetExponentShortestBitLength ( TSelf value ) => value . GetExponentShortestBitLength ( ) ;
@@ -118,6 +160,82 @@ public static class FloatingPointHelper<TSelf>
118
160
public static bool TryWriteSignificandBigEndian ( TSelf value , Span < byte > destination , out int bytesWritten ) => value . TryWriteSignificandBigEndian ( destination , out bytesWritten ) ;
119
161
120
162
public static bool TryWriteSignificandLittleEndian ( TSelf value , Span < byte > destination , out int bytesWritten ) => value . TryWriteSignificandLittleEndian ( destination , out bytesWritten ) ;
163
+
164
+ public static int WriteExponentBigEndian ( TSelf value , byte [ ] destination ) => value . WriteExponentBigEndian ( destination ) ;
165
+
166
+ public static int WriteExponentBigEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteExponentBigEndian ( destination , startIndex ) ;
167
+
168
+ public static int WriteExponentBigEndian ( TSelf value , Span < byte > destination ) => value . WriteExponentBigEndian ( destination ) ;
169
+
170
+ public static int WriteExponentLittleEndian ( TSelf value , byte [ ] destination ) => value . WriteExponentLittleEndian ( destination ) ;
171
+
172
+ public static int WriteExponentLittleEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteExponentLittleEndian ( destination , startIndex ) ;
173
+
174
+ public static int WriteExponentLittleEndian ( TSelf value , Span < byte > destination ) => value . WriteExponentLittleEndian ( destination ) ;
175
+
176
+ public static int WriteSignificandBigEndian ( TSelf value , byte [ ] destination ) => value . WriteSignificandBigEndian ( destination ) ;
177
+
178
+ public static int WriteSignificandBigEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteSignificandBigEndian ( destination , startIndex ) ;
179
+
180
+ public static int WriteSignificandBigEndian ( TSelf value , Span < byte > destination ) => value . WriteSignificandBigEndian ( destination ) ;
181
+
182
+ public static int WriteSignificandLittleEndian ( TSelf value , byte [ ] destination ) => value . WriteSignificandLittleEndian ( destination ) ;
183
+
184
+ public static int WriteSignificandLittleEndian ( TSelf value , byte [ ] destination , int startIndex ) => value . WriteSignificandLittleEndian ( destination , startIndex ) ;
185
+
186
+ public static int WriteSignificandLittleEndian ( TSelf value , Span < byte > destination ) => value . WriteSignificandLittleEndian ( destination ) ;
187
+ }
188
+
189
+ public static class FloatingPointIeee754Helper < TSelf >
190
+ where TSelf : IFloatingPointIeee754 < TSelf >
191
+ {
192
+ public static TSelf E => TSelf . E ;
193
+
194
+ public static TSelf Epsilon => TSelf . Epsilon ;
195
+
196
+ public static TSelf NaN => TSelf . NaN ;
197
+
198
+ public static TSelf NegativeInfinity => TSelf . NegativeInfinity ;
199
+
200
+ public static TSelf NegativeZero => TSelf . NegativeZero ;
201
+
202
+ public static TSelf Pi => TSelf . Pi ;
203
+
204
+ public static TSelf PositiveInfinity => TSelf . PositiveInfinity ;
205
+
206
+ public static TSelf Tau => TSelf . Tau ;
207
+
208
+ public static TSelf BitDecrement ( TSelf x ) => TSelf . BitDecrement ( x ) ;
209
+
210
+ public static TSelf BitIncrement ( TSelf x ) => TSelf . BitIncrement ( x ) ;
211
+
212
+ public static TSelf FusedMultiplyAdd ( TSelf left , TSelf right , TSelf addend ) => TSelf . FusedMultiplyAdd ( left , right , addend ) ;
213
+
214
+ public static TSelf Ieee754Remainder ( TSelf left , TSelf right ) => TSelf . Ieee754Remainder ( left , right ) ;
215
+
216
+ public static int ILogB ( TSelf x ) => TSelf . ILogB ( x ) ;
217
+
218
+ public static TSelf ReciprocalEstimate ( TSelf x ) => TSelf . ReciprocalEstimate ( x ) ;
219
+
220
+ public static TSelf ReciprocalSqrtEstimate ( TSelf x ) => TSelf . ReciprocalSqrtEstimate ( x ) ;
221
+
222
+ public static TSelf ScaleB ( TSelf x , int n ) => TSelf . ScaleB ( x , n ) ;
223
+ }
224
+
225
+ public static class HyperbolicFunctionsHelper < TSelf >
226
+ where TSelf : IHyperbolicFunctions < TSelf >
227
+ {
228
+ public static TSelf Acosh ( TSelf x ) => TSelf . Acosh ( x ) ;
229
+
230
+ public static TSelf Asinh ( TSelf x ) => TSelf . Asinh ( x ) ;
231
+
232
+ public static TSelf Atanh ( TSelf x ) => TSelf . Atanh ( x ) ;
233
+
234
+ public static TSelf Cosh ( TSelf x ) => TSelf . Cosh ( x ) ;
235
+
236
+ public static TSelf Sinh ( TSelf x ) => TSelf . Sinh ( x ) ;
237
+
238
+ public static TSelf Tanh ( TSelf x ) => TSelf . Tanh ( x ) ;
121
239
}
122
240
123
241
public static class IncrementOperatorsHelper < TSelf >
@@ -128,6 +246,24 @@ public static class IncrementOperatorsHelper<TSelf>
128
246
public static TSelf op_CheckedIncrement ( TSelf value ) => checked ( ++ value ) ;
129
247
}
130
248
249
+ public static class LogarithmicFunctionsHelper < TSelf >
250
+ where TSelf : ILogarithmicFunctions < TSelf >
251
+ {
252
+ public static TSelf Log ( TSelf x ) => TSelf . Log ( x ) ;
253
+
254
+ public static TSelf Log ( TSelf x , TSelf newBase ) => TSelf . Log ( x , newBase ) ;
255
+
256
+ public static TSelf LogP1 ( TSelf x ) => TSelf . LogP1 ( x ) ;
257
+
258
+ public static TSelf Log2 ( TSelf x ) => TSelf . Log2 ( x ) ;
259
+
260
+ public static TSelf Log2P1 ( TSelf x ) => TSelf . Log2P1 ( x ) ;
261
+
262
+ public static TSelf Log10 ( TSelf x ) => TSelf . Log10 ( x ) ;
263
+
264
+ public static TSelf Log10P1 ( TSelf x ) => TSelf . Log10P1 ( x ) ;
265
+ }
266
+
131
267
public static class MinMaxValueHelper < TSelf >
132
268
where TSelf : IMinMaxValue < TSelf >
133
269
{
@@ -162,58 +298,72 @@ public static class NumberBaseHelper<TSelf>
162
298
public static TSelf One => TSelf . One ;
163
299
164
300
public static TSelf Zero => TSelf . Zero ;
165
- }
166
301
167
- public static class NumberHelper < TSelf >
168
- where TSelf : INumber < TSelf >
169
- {
170
302
public static TSelf Abs ( TSelf value ) => TSelf . Abs ( value ) ;
171
303
172
- public static TSelf Clamp ( TSelf value , TSelf min , TSelf max ) => TSelf . Clamp ( value , min , max ) ;
173
-
174
- public static TSelf CopySign ( TSelf value , TSelf sign ) => TSelf . CopySign ( value , sign ) ;
175
-
176
304
public static TSelf CreateChecked < TOther > ( TOther value )
177
- where TOther : INumber < TOther > => TSelf . CreateChecked ( value ) ;
305
+ where TOther : INumberBase < TOther > => TSelf . CreateChecked ( value ) ;
178
306
179
307
public static TSelf CreateSaturating < TOther > ( TOther value )
180
- where TOther : INumber < TOther > => TSelf . CreateSaturating ( value ) ;
308
+ where TOther : INumberBase < TOther > => TSelf . CreateSaturating ( value ) ;
181
309
182
310
public static TSelf CreateTruncating < TOther > ( TOther value )
183
- where TOther : INumber < TOther > => TSelf . CreateTruncating ( value ) ;
311
+ where TOther : INumberBase < TOther > => TSelf . CreateTruncating ( value ) ;
312
+
313
+ public static bool IsFinite ( TSelf value ) => TSelf . IsFinite ( value ) ;
314
+
315
+ public static bool IsInfinity ( TSelf value ) => TSelf . IsInfinity ( value ) ;
316
+
317
+ public static bool IsNaN ( TSelf value ) => TSelf . IsNaN ( value ) ;
184
318
185
319
public static bool IsNegative ( TSelf value ) => TSelf . IsNegative ( value ) ;
186
320
187
- public static TSelf Max ( TSelf x , TSelf y ) => TSelf . Max ( x , y ) ;
321
+ public static bool IsNegativeInfinity ( TSelf value ) => TSelf . IsNegativeInfinity ( value ) ;
322
+
323
+ public static bool IsNormal ( TSelf value ) => TSelf . IsNormal ( value ) ;
324
+
325
+ public static bool IsPositiveInfinity ( TSelf value ) => TSelf . IsPositiveInfinity ( value ) ;
326
+
327
+ public static bool IsSubnormal ( TSelf value ) => TSelf . IsSubnormal ( value ) ;
188
328
189
329
public static TSelf MaxMagnitude ( TSelf x , TSelf y ) => TSelf . MaxMagnitude ( x , y ) ;
190
330
191
- public static TSelf Min ( TSelf x , TSelf y ) => TSelf . Min ( x , y ) ;
331
+ public static TSelf MaxMagnitudeNumber ( TSelf x , TSelf y ) => TSelf . MaxMagnitudeNumber ( x , y ) ;
192
332
193
333
public static TSelf MinMagnitude ( TSelf x , TSelf y ) => TSelf . MinMagnitude ( x , y ) ;
194
334
195
- public static TSelf Parse ( string s , IFormatProvider provider ) => TSelf . Parse ( s , provider ) ;
335
+ public static TSelf MinMagnitudeNumber ( TSelf x , TSelf y ) => TSelf . MinMagnitudeNumber ( x , y ) ;
196
336
197
337
public static TSelf Parse ( string s , NumberStyles style , IFormatProvider provider ) => TSelf . Parse ( s , style , provider ) ;
198
338
199
- public static TSelf Parse ( ReadOnlySpan < char > s , IFormatProvider provider ) => TSelf . Parse ( s , provider ) ;
200
-
201
339
public static TSelf Parse ( ReadOnlySpan < char > s , NumberStyles style , IFormatProvider provider ) => TSelf . Parse ( s , style , provider ) ;
202
340
203
- public static int Sign ( TSelf value ) => TSelf . Sign ( value ) ;
204
-
205
341
public static bool TryCreate < TOther > ( TOther value , out TSelf result )
206
- where TOther : INumber < TOther > => TSelf . TryCreate ( value , out result ) ;
207
-
208
- public static bool TryParse ( string s , IFormatProvider provider , out TSelf result ) => TSelf . TryParse ( s , provider , out result ) ;
342
+ where TOther : INumberBase < TOther > => TSelf . TryCreate ( value , out result ) ;
209
343
210
344
public static bool TryParse ( string s , NumberStyles style , IFormatProvider provider , out TSelf result ) => TSelf . TryParse ( s , style , provider , out result ) ;
211
345
212
- public static bool TryParse ( ReadOnlySpan < char > s , IFormatProvider provider , out TSelf result ) => TSelf . TryParse ( s , provider , out result ) ;
213
-
214
346
public static bool TryParse ( ReadOnlySpan < char > s , NumberStyles style , IFormatProvider provider , out TSelf result ) => TSelf . TryParse ( s , style , provider , out result ) ;
215
347
}
216
348
349
+ public static class NumberHelper < TSelf >
350
+ where TSelf : INumber < TSelf >
351
+ {
352
+ public static TSelf Clamp ( TSelf value , TSelf min , TSelf max ) => TSelf . Clamp ( value , min , max ) ;
353
+
354
+ public static TSelf CopySign ( TSelf value , TSelf sign ) => TSelf . CopySign ( value , sign ) ;
355
+
356
+ public static TSelf Max ( TSelf x , TSelf y ) => TSelf . Max ( x , y ) ;
357
+
358
+ public static TSelf MaxNumber ( TSelf x , TSelf y ) => TSelf . MaxNumber ( x , y ) ;
359
+
360
+ public static TSelf Min ( TSelf x , TSelf y ) => TSelf . Min ( x , y ) ;
361
+
362
+ public static TSelf MinNumber ( TSelf x , TSelf y ) => TSelf . MinNumber ( x , y ) ;
363
+
364
+ public static int Sign ( TSelf value ) => TSelf . Sign ( value ) ;
365
+ }
366
+
217
367
public static class ParsableHelper < TSelf >
218
368
where TSelf : IParsable < TSelf >
219
369
{
@@ -222,6 +372,20 @@ public static class ParsableHelper<TSelf>
222
372
public static bool TryParse ( string s , IFormatProvider provider , out TSelf result ) => TSelf . TryParse ( s , provider , out result ) ;
223
373
}
224
374
375
+ public static class PowerFunctionsHelper < TSelf >
376
+ where TSelf : IPowerFunctions < TSelf >
377
+ {
378
+ public static TSelf Pow ( TSelf x , TSelf y ) => TSelf . Pow ( x , y ) ;
379
+ }
380
+
381
+ public static class RootFunctionsHelper < TSelf >
382
+ where TSelf : IRootFunctions < TSelf >
383
+ {
384
+ public static TSelf Cbrt ( TSelf x ) => TSelf . Cbrt ( x ) ;
385
+
386
+ public static TSelf Sqrt ( TSelf x ) => TSelf . Sqrt ( x ) ;
387
+ }
388
+
225
389
public static class ShiftOperatorsHelper < TSelf , TResult >
226
390
where TSelf : IShiftOperators < TSelf , TResult >
227
391
{
@@ -254,6 +418,26 @@ public static class SubtractionOperatorsHelper<TSelf, TOther, TResult>
254
418
public static TResult op_CheckedSubtraction ( TSelf left , TOther right ) => checked ( left - right ) ;
255
419
}
256
420
421
+ public static class TrigonometricFunctionsHelper < TSelf >
422
+ where TSelf : ITrigonometricFunctions < TSelf >
423
+ {
424
+ public static TSelf Acos ( TSelf x ) => TSelf . Acos ( x ) ;
425
+
426
+ public static TSelf Asin ( TSelf x ) => TSelf . Asin ( x ) ;
427
+
428
+ public static TSelf Atan ( TSelf x ) => TSelf . Atan ( x ) ;
429
+
430
+ public static TSelf Atan2 ( TSelf y , TSelf x ) => TSelf . Atan2 ( y , x ) ;
431
+
432
+ public static TSelf Cos ( TSelf x ) => TSelf . Cos ( x ) ;
433
+
434
+ public static TSelf Sin ( TSelf x ) => TSelf . Sin ( x ) ;
435
+
436
+ public static ( TSelf Sin , TSelf Cos ) SinCos ( TSelf x ) => TSelf . SinCos ( x ) ;
437
+
438
+ public static TSelf Tan ( TSelf x ) => TSelf . Tan ( x ) ;
439
+ }
440
+
257
441
public static class UnaryNegationOperatorsHelper < TSelf , TResult >
258
442
where TSelf : IUnaryNegationOperators < TSelf , TResult >
259
443
{
0 commit comments