25 implementations of TryConvertToTruncating
System.Private.CoreLib (22)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
1029
static bool INumberBase<byte>.
TryConvertToTruncating
<TOther>(byte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1901
static bool INumberBase<char>.
TryConvertToTruncating
<TOther>(char value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1692
static bool INumberBase<decimal>.
TryConvertToTruncating
<TOther>(decimal value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1392
static bool INumberBase<double>.
TryConvertToTruncating
<TOther>(double value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
2126
static bool INumberBase<Half>.
TryConvertToTruncating
<TOther>(Half value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1842
static bool INumberBase<Int128>.
TryConvertToTruncating
<TOther>(Int128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
1234
static bool INumberBase<short>.
TryConvertToTruncating
<TOther>(short value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
1285
static bool INumberBase<int>.
TryConvertToTruncating
<TOther>(int value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
1288
static bool INumberBase<long>.
TryConvertToTruncating
<TOther>(long value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
1305
static bool INumberBase<nint>.
TryConvertToTruncating
<TOther>(nint value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (1)
1808
static bool INumberBase<BFloat16>.
TryConvertToTruncating
<TOther>(BFloat16 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (1)
1611
static bool INumberBase<Decimal128>.
TryConvertToTruncating
<TOther>(Decimal128 value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (1)
1622
static bool INumberBase<Decimal32>.
TryConvertToTruncating
<TOther>(Decimal32 value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (1)
1615
static bool INumberBase<Decimal64>.
TryConvertToTruncating
<TOther>(Decimal64 value, [MaybeNullWhen(false)] out TOther result) => TryConvertTo(value, out result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1575
static bool INumberBase<NFloat>.
TryConvertToTruncating
<TOther>(NFloat value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
1213
static bool INumberBase<sbyte>.
TryConvertToTruncating
<TOther>(sbyte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1409
static bool INumberBase<float>.
TryConvertToTruncating
<TOther>(float value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1958
static bool INumberBase<UInt128>.
TryConvertToTruncating
<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
1034
static bool INumberBase<ushort>.
TryConvertToTruncating
<TOther>(ushort value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
1105
static bool INumberBase<uint>.
TryConvertToTruncating
<TOther>(uint value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
1106
static bool INumberBase<ulong>.
TryConvertToTruncating
<TOther>(ulong value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
1105
static bool INumberBase<nuint>.
TryConvertToTruncating
<TOther>(nuint value, [MaybeNullWhen(false)] out TOther result)
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (1)
4962
static bool INumberBase<BigInteger>.
TryConvertToTruncating
<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.cs (1)
792
static bool INumberBase<Complex>.
TryConvertToTruncating
<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.Generic.cs (1)
1770
static bool INumberBase<Complex<T>>.
TryConvertToTruncating
<TOther>(Complex<T> value, [MaybeNullWhen(false)] out TOther result)
52 references to TryConvertToTruncating
System.Private.CoreLib (44)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (2)
605
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1027
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1899
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1333
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1690
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (2)
1112
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1390
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
1858
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
2124
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (2)
1333
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1840
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
705
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1232
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
747
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1283
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
744
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1286
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
767
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1303
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (2)
1447
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1806
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (2)
1352
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1609
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (2)
1363
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1620
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (2)
1356
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1613
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (1)
117
else if (!TSelf.TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
<TSelf>(value, out result))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (2)
1269
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1573
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
684
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1211
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (2)
1107
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1407
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (2)
1530
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1956
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (2)
610
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1032
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (2)
675
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1103
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (2)
682
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1104
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (2)
681
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1103
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
System.Runtime.Numerics (8)
System\Numerics\BigInteger.cs (2)
4166
else if (!TryConvertFromTruncating(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
4960
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
System\Numerics\Complex.cs (2)
574
else if (!TryConvertFrom(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
790
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
System\Numerics\Complex.Generic.cs (4)
1236
else if (!TryConvertFromTruncatingCore(value, out result) && !TOther.
TryConvertToTruncating
(value, out result))
1732
if (TOther.
TryConvertToTruncating
<T>(value, out T? realResult2) && realResult2 is not null)
1768
/// <inheritdoc cref="INumberBase{TSelf}.
TryConvertToTruncating
{TOther}(TSelf, out TOther)" />
1882
if (T.
TryConvertToTruncating
(value.m_real, out result))