25 implementations of TryConvertToTruncating
System.Private.CoreLib (22)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
1029static bool INumberBase<byte>.TryConvertToTruncating<TOther>(byte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1901static bool INumberBase<char>.TryConvertToTruncating<TOther>(char value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1692static bool INumberBase<decimal>.TryConvertToTruncating<TOther>(decimal value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1392static bool INumberBase<double>.TryConvertToTruncating<TOther>(double value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
2126static bool INumberBase<Half>.TryConvertToTruncating<TOther>(Half value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1842static bool INumberBase<Int128>.TryConvertToTruncating<TOther>(Int128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
1234static bool INumberBase<short>.TryConvertToTruncating<TOther>(short value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
1285static bool INumberBase<int>.TryConvertToTruncating<TOther>(int value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
1288static bool INumberBase<long>.TryConvertToTruncating<TOther>(long value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
1305static 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)
1808static 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)
1611static 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)
1622static 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)
1615static 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)
1575static bool INumberBase<NFloat>.TryConvertToTruncating<TOther>(NFloat value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
1213static bool INumberBase<sbyte>.TryConvertToTruncating<TOther>(sbyte value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1409static bool INumberBase<float>.TryConvertToTruncating<TOther>(float value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1958static bool INumberBase<UInt128>.TryConvertToTruncating<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
1034static bool INumberBase<ushort>.TryConvertToTruncating<TOther>(ushort value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
1105static bool INumberBase<uint>.TryConvertToTruncating<TOther>(uint value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
1106static bool INumberBase<ulong>.TryConvertToTruncating<TOther>(ulong value, [MaybeNullWhen(false)] out TOther result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
1105static bool INumberBase<nuint>.TryConvertToTruncating<TOther>(nuint value, [MaybeNullWhen(false)] out TOther result)
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (1)
4962static bool INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.cs (1)
792static bool INumberBase<Complex>.TryConvertToTruncating<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result)
System\Numerics\Complex.Generic.cs (1)
1770static 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)
605else 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)
1333else 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)
1112else 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)
1858else 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)
1333else 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)
705else 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)
747else 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)
744else 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)
767else 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)
1447else 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)
1352else 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)
1363else 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)
1356else 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)
117else 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)
1269else 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)
684else 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)
1107else 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)
1530else 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)
610else 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)
675else 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)
682else 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)
681else 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)
4166else 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)
574else 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)
1236else if (!TryConvertFromTruncatingCore(value, out result) && !TOther.TryConvertToTruncating(value, out result)) 1732if (TOther.TryConvertToTruncating<T>(value, out T? realResult2) && realResult2 is not null) 1768/// <inheritdoc cref="INumberBase{TSelf}.TryConvertToTruncating{TOther}(TSelf, out TOther)" /> 1882if (T.TryConvertToTruncating(value.m_real, out result))