22 implementations of TryConvertToSaturating
System.Private.CoreLib (19)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
955
static bool INumberBase<byte>.
TryConvertToSaturating
<TOther>(byte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1827
static bool INumberBase<char>.
TryConvertToSaturating
<TOther>(char value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1687
static bool INumberBase<decimal>.
TryConvertToSaturating
<TOther>(decimal value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1383
static bool INumberBase<double>.
TryConvertToSaturating
<TOther>(double value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
2065
static bool INumberBase<Half>.
TryConvertToSaturating
<TOther>(Half value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1767
static bool INumberBase<Int128>.
TryConvertToSaturating
<TOther>(Int128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
1149
static bool INumberBase<short>.
TryConvertToSaturating
<TOther>(short value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
1214
static bool INumberBase<int>.
TryConvertToSaturating
<TOther>(int value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
1209
static bool INumberBase<long>.
TryConvertToSaturating
<TOther>(long value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
1229
static bool INumberBase<nint>.
TryConvertToSaturating
<TOther>(nint value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (1)
1801
static bool INumberBase<BFloat16>.
TryConvertToSaturating
<TOther>(BFloat16 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1568
static bool INumberBase<NFloat>.
TryConvertToSaturating
<TOther>(NFloat value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
1129
static bool INumberBase<sbyte>.
TryConvertToSaturating
<TOther>(sbyte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1402
static bool INumberBase<float>.
TryConvertToSaturating
<TOther>(float value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1876
static bool INumberBase<UInt128>.
TryConvertToSaturating
<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
960
static bool INumberBase<ushort>.
TryConvertToSaturating
<TOther>(ushort value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
1025
static bool INumberBase<uint>.
TryConvertToSaturating
<TOther>(uint value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
1032
static bool INumberBase<ulong>.
TryConvertToSaturating
<TOther>(ulong value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
1027
static bool INumberBase<nuint>.
TryConvertToSaturating
<TOther>(nuint value, [MaybeNullWhen(false)] out TOther result)
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (1)
4654
static bool INumberBase<BigInteger>.
TryConvertToSaturating
<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.cs (1)
796
static bool INumberBase<Complex>.
TryConvertToSaturating
<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.Generic.cs (1)
1321
static bool INumberBase<Complex<T>>.
TryConvertToSaturating
<TOther>(Complex<T> value, [MaybeNullWhen(false)] out TOther result)
46 references to TryConvertToSaturating
System.Private.CoreLib (38)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (2)
586
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
953
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1825
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1316
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1685
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (2)
1091
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1381
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
1785
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
2063
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (2)
1314
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1765
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
686
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1147
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
728
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1212
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
725
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1207
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
744
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1227
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (2)
1428
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1799
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (1)
92
else if (!TSelf.TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
<TSelf>(value, out result))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (2)
1250
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1566
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
665
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1127
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (2)
1088
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1400
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (2)
1509
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1874
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (2)
591
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
958
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (2)
656
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1023
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (2)
663
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1030
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (2)
658
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1025
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
System.Runtime.Numerics (8)
System\Numerics\BigInteger.cs (2)
4038
else if (!TryConvertFromSaturating(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
4652
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
System\Numerics\Complex.cs (2)
572
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
794
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
System\Numerics\Complex.Generic.cs (4)
781
else if (!TryConvertFromSaturatingCore(value, out result) && !TOther.
TryConvertToSaturating
(value, out result))
1264
if (TOther.
TryConvertToSaturating
<T>(value, out T? realResult2) && realResult2 is not null)
1319
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToSaturating
{TOther}(TSelf, out TOther)" />
1415
if (T.
TryConvertToSaturating
(value.m_real, out result))