Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Single.cs
Go to the documentation of this file.
6
7namespace System;
8
10[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
11public readonly struct Single : IComparable, IConvertible, ISpanFormattable, IFormattable, IComparable<float>, IEquatable<float>, IBinaryFloatingPoint<float>, IBinaryNumber<float>, IBitwiseOperators<float, float, float>, INumber<float>, IAdditionOperators<float, float, float>, IAdditiveIdentity<float, float>, IComparisonOperators<float, float>, IEqualityOperators<float, float>, IDecrementOperators<float>, IDivisionOperators<float, float, float>, IIncrementOperators<float>, IModulusOperators<float, float, float>, IMultiplicativeIdentity<float, float>, IMultiplyOperators<float, float, float>, ISpanParseable<float>, IParseable<float>, ISubtractionOperators<float, float, float>, IUnaryNegationOperators<float, float>, IUnaryPlusOperators<float, float>, IFloatingPoint<float>, ISignedNumber<float>, IMinMaxValue<float>
12{
13 private readonly float m_value;
14
15 public const float MinValue = -3.4028235E+38f;
16
17 public const float Epsilon = 1E-45f;
18
19 public const float MaxValue = 3.4028235E+38f;
20
21 public const float PositiveInfinity = 1f / 0f;
22
23 public const float NegativeInfinity = -1f / 0f;
24
25 public const float NaN = 0f / 0f;
26
27 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
29
30 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
31 static float IFloatingPoint<float>.E => (float)Math.E;
32
33 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
34 static float IFloatingPoint<float>.Epsilon => float.Epsilon;
35
36 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
37 static float IFloatingPoint<float>.NaN => float.NaN;
38
39 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
40 static float IFloatingPoint<float>.NegativeInfinity => float.NegativeInfinity;
41
42 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
44
45 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
46 static float IFloatingPoint<float>.Pi => (float)Math.PI;
47
48 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
49 static float IFloatingPoint<float>.PositiveInfinity => float.PositiveInfinity;
50
51 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
52 static float IFloatingPoint<float>.Tau => (float)Math.PI * 2f;
53
54 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
55 static float IMinMaxValue<float>.MinValue => float.MinValue;
56
57 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
58 static float IMinMaxValue<float>.MaxValue => float.MaxValue;
59
60 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
62
63 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
64 static float INumber<float>.One => 1f;
65
66 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
67 static float INumber<float>.Zero => 0f;
68
69 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
70 static float ISignedNumber<float>.NegativeOne => -1f;
71
72 [MethodImpl(MethodImplOptions.AggressiveInlining)]
73 [NonVersionable]
74 public static bool IsFinite(float f)
75 {
77 return (num & 0x7FFFFFFF) < 2139095040;
78 }
79
80 [MethodImpl(MethodImplOptions.AggressiveInlining)]
81 [NonVersionable]
82 public static bool IsInfinity(float f)
83 {
85 return (num & 0x7FFFFFFF) == 2139095040;
86 }
87
88 [MethodImpl(MethodImplOptions.AggressiveInlining)]
89 [NonVersionable]
90 public static bool IsNaN(float f)
91 {
92 return f != f;
93 }
94
95 [MethodImpl(MethodImplOptions.AggressiveInlining)]
96 [NonVersionable]
97 public static bool IsNegative(float f)
98 {
99 return BitConverter.SingleToInt32Bits(f) < 0;
100 }
101
102 [MethodImpl(MethodImplOptions.AggressiveInlining)]
103 [NonVersionable]
104 public static bool IsNegativeInfinity(float f)
105 {
106 return f == float.NegativeInfinity;
107 }
108
109 [NonVersionable]
110 public static bool IsNormal(float f)
111 {
112 int num = BitConverter.SingleToInt32Bits(f);
113 num &= 0x7FFFFFFF;
114 if (num < 2139095040 && num != 0)
115 {
116 return (num & 0x7F800000) != 0;
117 }
118 return false;
119 }
120
121 [MethodImpl(MethodImplOptions.AggressiveInlining)]
122 [NonVersionable]
123 public static bool IsPositiveInfinity(float f)
124 {
125 return f == float.PositiveInfinity;
126 }
127
128 [NonVersionable]
129 public static bool IsSubnormal(float f)
130 {
131 int num = BitConverter.SingleToInt32Bits(f);
132 num &= 0x7FFFFFFF;
133 if (num < 2139095040 && num != 0)
134 {
135 return (num & 0x7F800000) == 0;
136 }
137 return false;
138 }
139
140 internal static int ExtractExponentFromBits(uint bits)
141 {
142 return (int)((bits >> 23) & 0xFF);
143 }
144
145 internal static uint ExtractSignificandFromBits(uint bits)
146 {
147 return bits & 0x7FFFFFu;
148 }
149
150 public int CompareTo(object? value)
151 {
152 if (value == null)
153 {
154 return 1;
155 }
156 if (value is float num)
157 {
158 if (this < num)
159 {
160 return -1;
161 }
162 if (this > num)
163 {
164 return 1;
165 }
166 if (this == num)
167 {
168 return 0;
169 }
170 if (IsNaN(this))
171 {
172 if (!IsNaN(num))
173 {
174 return -1;
175 }
176 return 0;
177 }
178 return 1;
179 }
181 }
182
183 public int CompareTo(float value)
184 {
185 if (this < value)
186 {
187 return -1;
188 }
189 if (this > value)
190 {
191 return 1;
192 }
193 if (this == value)
194 {
195 return 0;
196 }
197 if (IsNaN(this))
198 {
199 if (!IsNaN(value))
200 {
201 return -1;
202 }
203 return 0;
204 }
205 return 1;
206 }
207
208 [NonVersionable]
209 public static bool operator ==(float left, float right)
210 {
211 return left == right;
212 }
213
214 [NonVersionable]
215 public static bool operator !=(float left, float right)
216 {
217 return left != right;
218 }
219
220 [NonVersionable]
221 public static bool operator <(float left, float right)
222 {
223 return left < right;
224 }
225
226 [NonVersionable]
227 public static bool operator >(float left, float right)
228 {
229 return left > right;
230 }
231
232 [NonVersionable]
233 public static bool operator <=(float left, float right)
234 {
235 return left <= right;
236 }
237
238 [NonVersionable]
239 public static bool operator >=(float left, float right)
240 {
241 return left >= right;
242 }
243
244 public override bool Equals([NotNullWhen(true)] object? obj)
245 {
246 if (!(obj is float num))
247 {
248 return false;
249 }
250 if (num == this)
251 {
252 return true;
253 }
254 if (IsNaN(num))
255 {
256 return IsNaN(this);
257 }
258 return false;
259 }
260
261 public bool Equals(float obj)
262 {
263 if (obj == this)
264 {
265 return true;
266 }
267 if (IsNaN(obj))
268 {
269 return IsNaN(this);
270 }
271 return false;
272 }
273
274 [MethodImpl(MethodImplOptions.AggressiveInlining)]
275 public override int GetHashCode()
276 {
277 int num = Unsafe.As<float, int>(ref Unsafe.AsRef(in m_value));
278 if (((num - 1) & 0x7FFFFFFF) >= 2139095040)
279 {
280 num &= 0x7F800000;
281 }
282 return num;
283 }
284
285 public override string ToString()
286 {
288 }
289
290 public string ToString(IFormatProvider? provider)
291 {
292 return Number.FormatSingle(this, null, NumberFormatInfo.GetInstance(provider));
293 }
294
295 public string ToString(string? format)
296 {
298 }
299
300 public string ToString(string? format, IFormatProvider? provider)
301 {
302 return Number.FormatSingle(this, format, NumberFormatInfo.GetInstance(provider));
303 }
304
305 public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider? provider = null)
306 {
307 return Number.TryFormatSingle(this, format, NumberFormatInfo.GetInstance(provider), destination, out charsWritten);
308 }
309
310 public static float Parse(string s)
311 {
312 if (s == null)
313 {
315 }
317 }
318
319 public static float Parse(string s, NumberStyles style)
320 {
322 if (s == null)
323 {
325 }
327 }
328
329 public static float Parse(string s, IFormatProvider? provider)
330 {
331 if (s == null)
332 {
334 }
335 return Number.ParseSingle(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.GetInstance(provider));
336 }
337
338 public static float Parse(string s, NumberStyles style, IFormatProvider? provider)
339 {
341 if (s == null)
342 {
344 }
345 return Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider));
346 }
347
348 public static float Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Float | NumberStyles.AllowThousands, IFormatProvider? provider = null)
349 {
351 return Number.ParseSingle(s, style, NumberFormatInfo.GetInstance(provider));
352 }
353
354 public static bool TryParse([NotNullWhen(true)] string? s, out float result)
355 {
356 if (s == null)
357 {
358 result = 0f;
359 return false;
360 }
361 return TryParse((ReadOnlySpan<char>)s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.CurrentInfo, out result);
362 }
363
364 public static bool TryParse(ReadOnlySpan<char> s, out float result)
365 {
366 return TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, NumberFormatInfo.CurrentInfo, out result);
367 }
368
369 public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out float result)
370 {
372 if (s == null)
373 {
374 result = 0f;
375 return false;
376 }
377 return TryParse((ReadOnlySpan<char>)s, style, NumberFormatInfo.GetInstance(provider), out result);
378 }
379
380 public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out float result)
381 {
383 return TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result);
384 }
385
386 private static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, NumberFormatInfo info, out float result)
387 {
388 return Number.TryParseSingle(s, style, info, out result);
389 }
390
392 {
393 return TypeCode.Single;
394 }
395
397 {
398 return Convert.ToBoolean(this);
399 }
400
402 {
403 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "Char"));
404 }
405
407 {
408 return Convert.ToSByte(this);
409 }
410
412 {
413 return Convert.ToByte(this);
414 }
415
417 {
418 return Convert.ToInt16(this);
419 }
420
422 {
423 return Convert.ToUInt16(this);
424 }
425
427 {
428 return Convert.ToInt32(this);
429 }
430
432 {
433 return Convert.ToUInt32(this);
434 }
435
437 {
438 return Convert.ToInt64(this);
439 }
440
442 {
443 return Convert.ToUInt64(this);
444 }
445
447 {
448 return this;
449 }
450
452 {
453 return Convert.ToDouble(this);
454 }
455
457 {
458 return Convert.ToDecimal(this);
459 }
460
462 {
463 throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "DateTime"));
464 }
465
467 {
468 return Convert.DefaultToType(this, type, provider);
469 }
470
471 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
472 static float IAdditionOperators<float, float, float>.operator +(float left, float right)
473 {
474 return left + right;
475 }
476
477 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
479 {
481 uint num2 = (num >> 23) & 0xFFu;
482 uint num3 = num & 0x7FFFFFu;
483 if (value > 0f && num2 != 0 && num2 != 255)
484 {
485 return num3 == 0;
486 }
487 return false;
488 }
489
490 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
491 static float IBinaryNumber<float>.Log2(float value)
492 {
493 return MathF.Log2(value);
494 }
495
496 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
497 static float IBitwiseOperators<float, float, float>.operator &(float left, float right)
498 {
501 }
502
503 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
504 static float IBitwiseOperators<float, float, float>.operator |(float left, float right)
505 {
508 }
509
510 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
511 static float IBitwiseOperators<float, float, float>.operator ^(float left, float right)
512 {
515 }
516
517 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
518 static float IBitwiseOperators<float, float, float>.operator ~(float value)
519 {
521 return BitConverter.UInt32BitsToSingle(value2);
522 }
523
524 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
525 static bool IComparisonOperators<float, float>.operator <(float left, float right)
526 {
527 return left < right;
528 }
529
530 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
531 static bool IComparisonOperators<float, float>.operator <=(float left, float right)
532 {
533 return left <= right;
534 }
535
536 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
537 static bool IComparisonOperators<float, float>.operator >(float left, float right)
538 {
539 return left > right;
540 }
541
542 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
543 static bool IComparisonOperators<float, float>.operator >=(float left, float right)
544 {
545 return left >= right;
546 }
547
548 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
549 static float IDecrementOperators<float>.operator --(float value)
550 {
551 return value -= 1f;
552 }
553
554 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
555 static float IDivisionOperators<float, float, float>.operator /(float left, float right)
556 {
557 return left / right;
558 }
559
560 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
561 static bool IEqualityOperators<float, float>.operator ==(float left, float right)
562 {
563 return left == right;
564 }
565
566 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
567 static bool IEqualityOperators<float, float>.operator !=(float left, float right)
568 {
569 return left != right;
570 }
571
572 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
573 static float IFloatingPoint<float>.Acos(float x)
574 {
575 return MathF.Acos(x);
576 }
577
578 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
579 static float IFloatingPoint<float>.Acosh(float x)
580 {
581 return MathF.Acosh(x);
582 }
583
584 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
585 static float IFloatingPoint<float>.Asin(float x)
586 {
587 return MathF.Asin(x);
588 }
589
590 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
591 static float IFloatingPoint<float>.Asinh(float x)
592 {
593 return MathF.Asinh(x);
594 }
595
596 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
597 static float IFloatingPoint<float>.Atan(float x)
598 {
599 return MathF.Atan(x);
600 }
601
602 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
603 static float IFloatingPoint<float>.Atan2(float y, float x)
604 {
605 return MathF.Atan2(y, x);
606 }
607
608 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
609 static float IFloatingPoint<float>.Atanh(float x)
610 {
611 return MathF.Atanh(x);
612 }
613
614 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
616 {
617 return MathF.BitIncrement(x);
618 }
619
620 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
622 {
623 return MathF.BitDecrement(x);
624 }
625
626 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
627 static float IFloatingPoint<float>.Cbrt(float x)
628 {
629 return MathF.Cbrt(x);
630 }
631
632 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
633 static float IFloatingPoint<float>.Ceiling(float x)
634 {
635 return MathF.Ceiling(x);
636 }
637
638 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
639 static float IFloatingPoint<float>.CopySign(float x, float y)
640 {
641 return MathF.CopySign(x, y);
642 }
643
644 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
645 static float IFloatingPoint<float>.Cos(float x)
646 {
647 return MathF.Cos(x);
648 }
649
650 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
651 static float IFloatingPoint<float>.Cosh(float x)
652 {
653 return MathF.Cosh(x);
654 }
655
656 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
657 static float IFloatingPoint<float>.Exp(float x)
658 {
659 return MathF.Exp(x);
660 }
661
662 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
663 static float IFloatingPoint<float>.Floor(float x)
664 {
665 return MathF.Floor(x);
666 }
667
668 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
669 static float IFloatingPoint<float>.FusedMultiplyAdd(float left, float right, float addend)
670 {
671 return MathF.FusedMultiplyAdd(left, right, addend);
672 }
673
674 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
675 static float IFloatingPoint<float>.IEEERemainder(float left, float right)
676 {
677 return MathF.IEEERemainder(left, right);
678 }
679
680 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
681 static TInteger IFloatingPoint<float>.ILogB<TInteger>(float x)
682 {
683 return TInteger.Create(MathF.ILogB(x));
684 }
685
686 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
687 static float IFloatingPoint<float>.Log(float x)
688 {
689 return MathF.Log(x);
690 }
691
692 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
693 static float IFloatingPoint<float>.Log(float x, float newBase)
694 {
695 return MathF.Log(x, newBase);
696 }
697
698 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
699 static float IFloatingPoint<float>.Log2(float x)
700 {
701 return MathF.Log2(x);
702 }
703
704 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
705 static float IFloatingPoint<float>.Log10(float x)
706 {
707 return MathF.Log10(x);
708 }
709
710 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
711 static float IFloatingPoint<float>.MaxMagnitude(float x, float y)
712 {
713 return MathF.MaxMagnitude(x, y);
714 }
715
716 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
717 static float IFloatingPoint<float>.MinMagnitude(float x, float y)
718 {
719 return MathF.MinMagnitude(x, y);
720 }
721
722 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
723 static float IFloatingPoint<float>.Pow(float x, float y)
724 {
725 return MathF.Pow(x, y);
726 }
727
728 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
729 static float IFloatingPoint<float>.Round(float x)
730 {
731 return MathF.Round(x);
732 }
733
734 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
735 static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits)
736 {
737 return MathF.Round(x, int.Create(digits));
738 }
739
740 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
741 static float IFloatingPoint<float>.Round(float x, MidpointRounding mode)
742 {
743 return MathF.Round(x, mode);
744 }
745
746 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
747 static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits, MidpointRounding mode)
748 {
749 return MathF.Round(x, int.Create(digits), mode);
750 }
751
752 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
753 static float IFloatingPoint<float>.ScaleB<TInteger>(float x, TInteger n)
754 {
755 return MathF.ScaleB(x, int.Create(n));
756 }
757
758 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
759 static float IFloatingPoint<float>.Sin(float x)
760 {
761 return MathF.Sin(x);
762 }
763
764 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
765 static float IFloatingPoint<float>.Sinh(float x)
766 {
767 return MathF.Sinh(x);
768 }
769
770 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
771 static float IFloatingPoint<float>.Sqrt(float x)
772 {
773 return MathF.Sqrt(x);
774 }
775
776 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
777 static float IFloatingPoint<float>.Tan(float x)
778 {
779 return MathF.Tan(x);
780 }
781
782 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
783 static float IFloatingPoint<float>.Tanh(float x)
784 {
785 return MathF.Tanh(x);
786 }
787
788 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
789 static float IFloatingPoint<float>.Truncate(float x)
790 {
791 return MathF.Truncate(x);
792 }
793
794 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
795 static bool IFloatingPoint<float>.IsFinite(float x)
796 {
797 return IsFinite(x);
798 }
799
800 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
802 {
803 return IsInfinity(x);
804 }
805
806 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
807 static bool IFloatingPoint<float>.IsNaN(float x)
808 {
809 return IsNaN(x);
810 }
811
812 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
814 {
815 return IsNegative(x);
816 }
817
818 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
820 {
821 return IsNegativeInfinity(x);
822 }
823
824 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
825 static bool IFloatingPoint<float>.IsNormal(float x)
826 {
827 return IsNormal(x);
828 }
829
830 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
832 {
833 return IsPositiveInfinity(x);
834 }
835
836 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
838 {
839 return IsSubnormal(x);
840 }
841
842 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
843 static float IIncrementOperators<float>.operator ++(float value)
844 {
845 return value += 1f;
846 }
847
848 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
849 static float IModulusOperators<float, float, float>.operator %(float left, float right)
850 {
851 return left % right;
852 }
853
854 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
855 static float IMultiplyOperators<float, float, float>.operator *(float left, float right)
856 {
857 return left * right;
858 }
859
860 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
861 static float INumber<float>.Abs(float value)
862 {
863 return MathF.Abs(value);
864 }
865
866 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
867 static float INumber<float>.Clamp(float value, float min, float max)
868 {
869 return Math.Clamp(value, min, max);
870 }
871
872 [MethodImpl(MethodImplOptions.AggressiveInlining)]
873 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
874 static float INumber<float>.Create<TOther>(TOther value)
875 {
876 if (typeof(TOther) == typeof(byte))
877 {
878 return (int)(byte)(object)value;
879 }
880 if (typeof(TOther) == typeof(char))
881 {
882 return (int)(char)(object)value;
883 }
884 if (typeof(TOther) == typeof(decimal))
885 {
886 return (float)(decimal)(object)value;
887 }
888 if (typeof(TOther) == typeof(double))
889 {
890 return (float)(double)(object)value;
891 }
892 if (typeof(TOther) == typeof(short))
893 {
894 return (short)(object)value;
895 }
896 if (typeof(TOther) == typeof(int))
897 {
898 return (int)(object)value;
899 }
900 if (typeof(TOther) == typeof(long))
901 {
902 return (long)(object)value;
903 }
904 if (typeof(TOther) == typeof(IntPtr))
905 {
906 return (nint)(IntPtr)(object)value;
907 }
908 if (typeof(TOther) == typeof(sbyte))
909 {
910 return (sbyte)(object)value;
911 }
912 if (typeof(TOther) == typeof(float))
913 {
914 return (float)(object)value;
915 }
916 if (typeof(TOther) == typeof(ushort))
917 {
918 return (int)(ushort)(object)value;
919 }
920 if (typeof(TOther) == typeof(uint))
921 {
922 return (uint)(object)value;
923 }
924 if (typeof(TOther) == typeof(ulong))
925 {
926 return (ulong)(object)value;
927 }
928 if (typeof(TOther) == typeof(UIntPtr))
929 {
930 return (nint)(nuint)(UIntPtr)(object)value;
931 }
933 return 0f;
934 }
935
936 [MethodImpl(MethodImplOptions.AggressiveInlining)]
937 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
938 static float INumber<float>.CreateSaturating<TOther>(TOther value)
939 {
940 if (typeof(TOther) == typeof(byte))
941 {
942 return (int)(byte)(object)value;
943 }
944 if (typeof(TOther) == typeof(char))
945 {
946 return (int)(char)(object)value;
947 }
948 if (typeof(TOther) == typeof(decimal))
949 {
950 return (float)(decimal)(object)value;
951 }
952 if (typeof(TOther) == typeof(double))
953 {
954 return (float)(double)(object)value;
955 }
956 if (typeof(TOther) == typeof(short))
957 {
958 return (short)(object)value;
959 }
960 if (typeof(TOther) == typeof(int))
961 {
962 return (int)(object)value;
963 }
964 if (typeof(TOther) == typeof(long))
965 {
966 return (long)(object)value;
967 }
968 if (typeof(TOther) == typeof(IntPtr))
969 {
970 return (nint)(IntPtr)(object)value;
971 }
972 if (typeof(TOther) == typeof(sbyte))
973 {
974 return (sbyte)(object)value;
975 }
976 if (typeof(TOther) == typeof(float))
977 {
978 return (float)(object)value;
979 }
980 if (typeof(TOther) == typeof(ushort))
981 {
982 return (int)(ushort)(object)value;
983 }
984 if (typeof(TOther) == typeof(uint))
985 {
986 return (uint)(object)value;
987 }
988 if (typeof(TOther) == typeof(ulong))
989 {
990 return (ulong)(object)value;
991 }
992 if (typeof(TOther) == typeof(UIntPtr))
993 {
994 return (nint)(nuint)(UIntPtr)(object)value;
995 }
997 return 0f;
998 }
999
1000 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1001 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1002 static float INumber<float>.CreateTruncating<TOther>(TOther value)
1003 {
1004 if (typeof(TOther) == typeof(byte))
1005 {
1006 return (int)(byte)(object)value;
1007 }
1008 if (typeof(TOther) == typeof(char))
1009 {
1010 return (int)(char)(object)value;
1011 }
1012 if (typeof(TOther) == typeof(decimal))
1013 {
1014 return (float)(decimal)(object)value;
1015 }
1016 if (typeof(TOther) == typeof(double))
1017 {
1018 return (float)(double)(object)value;
1019 }
1020 if (typeof(TOther) == typeof(short))
1021 {
1022 return (short)(object)value;
1023 }
1024 if (typeof(TOther) == typeof(int))
1025 {
1026 return (int)(object)value;
1027 }
1028 if (typeof(TOther) == typeof(long))
1029 {
1030 return (long)(object)value;
1031 }
1032 if (typeof(TOther) == typeof(IntPtr))
1033 {
1034 return (nint)(IntPtr)(object)value;
1035 }
1036 if (typeof(TOther) == typeof(sbyte))
1037 {
1038 return (sbyte)(object)value;
1039 }
1040 if (typeof(TOther) == typeof(float))
1041 {
1042 return (float)(object)value;
1043 }
1044 if (typeof(TOther) == typeof(ushort))
1045 {
1046 return (int)(ushort)(object)value;
1047 }
1048 if (typeof(TOther) == typeof(uint))
1049 {
1050 return (uint)(object)value;
1051 }
1052 if (typeof(TOther) == typeof(ulong))
1053 {
1054 return (ulong)(object)value;
1055 }
1056 if (typeof(TOther) == typeof(UIntPtr))
1057 {
1058 return (nint)(nuint)(UIntPtr)(object)value;
1059 }
1061 return 0f;
1062 }
1063
1064 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1065 static (float Quotient, float Remainder) INumber<float>.DivRem(float left, float right)
1066 {
1067 return (Quotient: left / right, Remainder: left % right);
1068 }
1069
1070 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1071 static float INumber<float>.Max(float x, float y)
1072 {
1073 return MathF.Max(x, y);
1074 }
1075
1076 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1077 static float INumber<float>.Min(float x, float y)
1078 {
1079 return MathF.Min(x, y);
1080 }
1081
1082 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1083 static float INumber<float>.Parse(string s, NumberStyles style, IFormatProvider provider)
1084 {
1085 return Parse(s, style, provider);
1086 }
1087
1088 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1090 {
1091 return Parse(s, style, provider);
1092 }
1093
1094 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1095 static float INumber<float>.Sign(float value)
1096 {
1097 return MathF.Sign(value);
1098 }
1099
1100 [MethodImpl(MethodImplOptions.AggressiveInlining)]
1101 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1102 static bool INumber<float>.TryCreate<TOther>(TOther value, out float result)
1103 {
1104 if (typeof(TOther) == typeof(byte))
1105 {
1106 result = (int)(byte)(object)value;
1107 return true;
1108 }
1109 if (typeof(TOther) == typeof(char))
1110 {
1111 result = (int)(char)(object)value;
1112 return true;
1113 }
1114 if (typeof(TOther) == typeof(decimal))
1115 {
1116 result = (float)(decimal)(object)value;
1117 return true;
1118 }
1119 if (typeof(TOther) == typeof(double))
1120 {
1121 result = (float)(double)(object)value;
1122 return true;
1123 }
1124 if (typeof(TOther) == typeof(short))
1125 {
1126 result = (short)(object)value;
1127 return true;
1128 }
1129 if (typeof(TOther) == typeof(int))
1130 {
1131 result = (int)(object)value;
1132 return true;
1133 }
1134 if (typeof(TOther) == typeof(long))
1135 {
1136 result = (long)(object)value;
1137 return true;
1138 }
1139 if (typeof(TOther) == typeof(IntPtr))
1140 {
1141 result = (nint)(IntPtr)(object)value;
1142 return true;
1143 }
1144 if (typeof(TOther) == typeof(sbyte))
1145 {
1146 result = (sbyte)(object)value;
1147 return true;
1148 }
1149 if (typeof(TOther) == typeof(float))
1150 {
1151 result = (float)(object)value;
1152 return true;
1153 }
1154 if (typeof(TOther) == typeof(ushort))
1155 {
1156 result = (int)(ushort)(object)value;
1157 return true;
1158 }
1159 if (typeof(TOther) == typeof(uint))
1160 {
1161 result = (uint)(object)value;
1162 return true;
1163 }
1164 if (typeof(TOther) == typeof(ulong))
1165 {
1166 result = (ulong)(object)value;
1167 return true;
1168 }
1169 if (typeof(TOther) == typeof(UIntPtr))
1170 {
1171 result = (nint)(nuint)(UIntPtr)(object)value;
1172 return true;
1173 }
1175 result = 0f;
1176 return false;
1177 }
1178
1179 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1180 static bool INumber<float>.TryParse([NotNullWhen(true)] string s, NumberStyles style, IFormatProvider provider, out float result)
1181 {
1182 return TryParse(s, style, provider, out result);
1183 }
1184
1185 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1186 static bool INumber<float>.TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider provider, out float result)
1187 {
1188 return TryParse(s, style, provider, out result);
1189 }
1190
1191 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1192 static float IParseable<float>.Parse(string s, IFormatProvider provider)
1193 {
1194 return Parse(s, provider);
1195 }
1196
1197 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1198 static bool IParseable<float>.TryParse([NotNullWhen(true)] string s, IFormatProvider provider, out float result)
1199 {
1200 return TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
1201 }
1202
1203 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1205 {
1206 return Parse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider);
1207 }
1208
1209 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1210 static bool ISpanParseable<float>.TryParse(ReadOnlySpan<char> s, IFormatProvider provider, out float result)
1211 {
1212 return TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, provider, out result);
1213 }
1214
1215 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1216 static float ISubtractionOperators<float, float, float>.operator -(float left, float right)
1217 {
1218 return left - right;
1219 }
1220
1221 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1222 static float IUnaryNegationOperators<float, float>.operator -(float value)
1223 {
1224 return 0f - value;
1225 }
1226
1227 [RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
1228 static float IUnaryPlusOperators<float, float>.operator +(float value)
1229 {
1230 return value;
1231 }
1232}
static unsafe int SingleToInt32Bits(float value)
static uint SingleToUInt32Bits(float value)
static float UInt32BitsToSingle(uint value)
static decimal ToDecimal(object? value)
Definition Convert.cs:2101
static long ToInt64(object? value)
Definition Convert.cs:1623
static int ToInt32(object? value)
Definition Convert.cs:1320
static short ToInt16(object? value)
Definition Convert.cs:1038
static byte ToByte(object? value)
Definition Convert.cs:900
static uint ToUInt32(object? value)
Definition Convert.cs:1470
static ulong ToUInt64(object? value)
Definition Convert.cs:1738
static ushort ToUInt16(object? value)
Definition Convert.cs:1177
static sbyte ToSByte(object? value)
Definition Convert.cs:745
static double ToDouble(object? value)
Definition Convert.cs:1991
static bool ToBoolean([NotNullWhen(true)] object? value)
Definition Convert.cs:508
static object DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
Definition Convert.cs:269
static NumberFormatInfo GetInstance(IFormatProvider? formatProvider)
static void ValidateParseStyleFloatingPoint(NumberStyles style)
static float Abs(float x)
Definition MathF.cs:130
static float Log(float x)
static unsafe float Truncate(float x)
Definition MathF.cs:413
static int Sign(float x)
Definition MathF.cs:408
static float MinMagnitude(float x, float y)
Definition MathF.cs:280
static float ScaleB(float x, int n)
Definition MathF.cs:419
static float Log2(float x)
static float Max(float x, float y)
Definition MathF.cs:250
static float Atan(float x)
static float Acosh(float x)
static float FusedMultiplyAdd(float x, float y, float z)
static float Atan2(float y, float x)
static float Sqrt(float x)
static float BitIncrement(float x)
Definition MathF.cs:154
static float MaxMagnitude(float x, float y)
Definition MathF.cs:255
static float Pow(float x, float y)
static float Min(float x, float y)
Definition MathF.cs:275
static float Log10(float x)
static float Asinh(float x)
static float Acos(float x)
static float Cos(float x)
static float Sinh(float x)
static float Asin(float x)
static float Atanh(float x)
static float Cbrt(float x)
static float Cosh(float x)
static float IEEERemainder(float x, float y)
Definition MathF.cs:191
static float BitDecrement(float x)
Definition MathF.cs:135
static float CopySign(float x, float y)
Definition MathF.cs:174
static float Ceiling(float x)
static float Sin(float x)
static float Floor(float x)
static float Exp(float x)
static float Tan(float x)
static float Tanh(float x)
static int ILogB(float x)
static float Round(float x)
Definition MathF.cs:326
static byte Clamp(byte value, byte min, byte max)
Definition Math.cs:435
const double E
Definition Math.cs:14
const double PI
Definition Math.cs:16
static bool TryFormatSingle(float value, ReadOnlySpan< char > format, NumberFormatInfo info, Span< char > destination, out int charsWritten)
Definition Number.cs:1747
static unsafe bool TryParseSingle(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info, out float result)
Definition Number.cs:5775
static float ParseSingle(ReadOnlySpan< char > value, NumberStyles styles, NumberFormatInfo info)
Definition Number.cs:5622
static string FormatSingle(float value, string format, NumberFormatInfo info)
Definition Number.cs:1740
static string InvalidCast_FromTo
Definition SR.cs:1392
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Arg_MustBeSingle
Definition SR.cs:296
Definition SR.cs:7
static void ThrowNotSupportedException(ExceptionResource resource)
static void ThrowArgumentNullException(string name)
static TResult AdditiveIdentity
static bool IsPow2(TSelf value)
static TSelf Log2(TSelf value)
short ToInt16(IFormatProvider? provider)
char ToChar(IFormatProvider? provider)
byte ToByte(IFormatProvider? provider)
decimal ToDecimal(IFormatProvider? provider)
object ToType(Type conversionType, IFormatProvider? provider)
uint ToUInt32(IFormatProvider? provider)
DateTime ToDateTime(IFormatProvider? provider)
int ToInt32(IFormatProvider? provider)
long ToInt64(IFormatProvider? provider)
ushort ToUInt16(IFormatProvider? provider)
double ToDouble(IFormatProvider? provider)
float ToSingle(IFormatProvider? provider)
sbyte ToSByte(IFormatProvider? provider)
ulong ToUInt64(IFormatProvider? provider)
bool ToBoolean(IFormatProvider? provider)
static bool IsNaN(TSelf value)
static TSelf CopySign(TSelf x, TSelf y)
static bool IsPositiveInfinity(TSelf value)
static TSelf Acosh(TSelf x)
static TSelf MinMagnitude(TSelf x, TSelf y)
static TSelf Log10(TSelf x)
static TSelf Ceiling(TSelf x)
static bool IsFinite(TSelf value)
static bool IsNegativeInfinity(TSelf value)
static TSelf MaxMagnitude(TSelf x, TSelf y)
static TSelf PositiveInfinity
static TSelf IEEERemainder(TSelf left, TSelf right)
static TSelf Pow(TSelf x, TSelf y)
static TSelf Asin(TSelf x)
static TSelf Floor(TSelf x)
static TSelf Truncate(TSelf x)
static TSelf Asinh(TSelf x)
static TSelf Atanh(TSelf x)
static TSelf NegativeZero
static TSelf Log(TSelf x)
static TSelf Cbrt(TSelf x)
static TSelf BitIncrement(TSelf x)
static TSelf Tan(TSelf x)
static TSelf Sinh(TSelf x)
static bool IsInfinity(TSelf value)
static bool IsSubnormal(TSelf value)
static TSelf Tanh(TSelf x)
static TSelf Exp(TSelf x)
static bool IsNegative(TSelf value)
static TSelf Atan(TSelf x)
static TSelf Sqrt(TSelf x)
static TSelf BitDecrement(TSelf x)
static TSelf FusedMultiplyAdd(TSelf left, TSelf right, TSelf addend)
static TSelf Sin(TSelf x)
static TSelf Acos(TSelf x)
static TSelf Round(TSelf x)
static bool IsNormal(TSelf value)
static TSelf Atan2(TSelf y, TSelf x)
static TSelf Cos(TSelf x)
static TSelf Cosh(TSelf x)
static TSelf NegativeInfinity
static TSelf Log2(TSelf x)
static TSelf MinValue
static TSelf MaxValue
static TSelf Max(TSelf x, TSelf y)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, NumberStyles style, IFormatProvider? provider)
static TSelf Sign(TSelf value)
static TSelf Min(TSelf x, TSelf y)
static TSelf One
Definition INumber.cs:10
static TSelf Zero
Definition INumber.cs:12
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)
static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(string s, IFormatProvider? provider)
static TSelf NegativeOne
static bool TryParse(ReadOnlySpan< char > s, IFormatProvider? provider, out TSelf result)
static TSelf Parse(ReadOnlySpan< char > s, IFormatProvider? provider)
TypeCode
Definition TypeCode.cs:4
static float Parse(string s, IFormatProvider? provider)
Definition Single.cs:329
int CompareTo(float value)
Definition Single.cs:183
string ToString(string? format, IFormatProvider? provider)
Definition Single.cs:300
static bool IsNegative(float f)
Definition Single.cs:97
const float MaxValue
Definition Single.cs:19
static float float Remainder INumber< float >. DivRem(float left, float right)
Definition Single.cs:1065
static int ExtractExponentFromBits(uint bits)
Definition Single.cs:140
string ToString(string? format)
Definition Single.cs:295
static bool operator!=(float left, float right)
Definition Single.cs:215
static uint ExtractSignificandFromBits(uint bits)
Definition Single.cs:145
const float MinValue
Definition Single.cs:15
static bool IsSubnormal(float f)
Definition Single.cs:129
static bool IsNegativeInfinity(float f)
Definition Single.cs:104
static bool operator==(float left, float right)
Definition Single.cs:209
override string ToString()
Definition Single.cs:285
static float Quotient
Definition Single.cs:1065
static bool TryParse([NotNullWhen(true)] string? s, out float result)
Definition Single.cs:354
static bool IsNaN(float f)
Definition Single.cs:90
static bool IsNormal(float f)
Definition Single.cs:110
const float NegativeInfinity
Definition Single.cs:23
static float Parse(string s, NumberStyles style, IFormatProvider? provider)
Definition Single.cs:338
int CompareTo(object? value)
Definition Single.cs:150
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out float result)
Definition Single.cs:369
static bool operator>(float left, float right)
Definition Single.cs:227
override bool Equals([NotNullWhen(true)] object? obj)
Definition Single.cs:244
readonly float m_value
Definition Single.cs:13
static bool operator<=(float left, float right)
Definition Single.cs:233
TypeCode GetTypeCode()
Definition Single.cs:391
static float Parse(string s)
Definition Single.cs:310
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider, out float result)
Definition Single.cs:380
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, NumberFormatInfo info, out float result)
Definition Single.cs:386
static bool operator<(float left, float right)
Definition Single.cs:221
static bool operator>=(float left, float right)
Definition Single.cs:239
static bool IsInfinity(float f)
Definition Single.cs:82
static float IFloatingPoint< float >. E
Definition Single.cs:31
static bool IsFinite(float f)
Definition Single.cs:74
static bool IsPositiveInfinity(float f)
Definition Single.cs:123
bool TryFormat(Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
Definition Single.cs:305
static bool TryParse(ReadOnlySpan< char > s, out float result)
Definition Single.cs:364
static float Parse(ReadOnlySpan< char > s, NumberStyles style=NumberStyles.Float|NumberStyles.AllowThousands, IFormatProvider? provider=null)
Definition Single.cs:348
const float PositiveInfinity
Definition Single.cs:21
string ToString(IFormatProvider? provider)
Definition Single.cs:290
override int GetHashCode()
Definition Single.cs:275
static float Parse(string s, NumberStyles style)
Definition Single.cs:319
bool Equals(float obj)
Definition Single.cs:261
const float Epsilon
Definition Single.cs:17
const float NaN
Definition Single.cs:25