TensorPrimitives.ConvertTruncating<TFrom,TTo> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies source
to destination
, converting each TFrom
value to a TTo
value.
public:
generic <typename TFrom, typename TTo>
where TFrom : System::Numerics::INumberBase<TFrom> where TTo : System::Numerics::INumberBase<TTo> static void ConvertTruncating(ReadOnlySpan<TFrom> source, Span<TTo> destination);
public static void ConvertTruncating<TFrom,TTo> (ReadOnlySpan<TFrom> source, Span<TTo> destination) where TFrom : System.Numerics.INumberBase<TFrom> where TTo : System.Numerics.INumberBase<TTo>;
static member ConvertTruncating : ReadOnlySpan<'From (requires 'From :> System.Numerics.INumberBase<'From>)> * Span<'o (requires 'o :> System.Numerics.INumberBase<'o>)> -> unit (requires 'From :> System.Numerics.INumberBase<'From> and 'o :> System.Numerics.INumberBase<'o>)
Public Shared Sub ConvertTruncating(Of TFrom As INumberBase(Of TFrom), TTo As INumberBase(Of TFrom)) (source As ReadOnlySpan(Of TFrom), destination As Span(Of TTo))
Type Parameters
- TFrom
- TTo
Parameters
- source
- ReadOnlySpan<TFrom>
The source span from which to copy values.
- destination
- Span<TTo>
The destination span into which the converted values should be written.
Exceptions
Destination is too short.
Remarks
This method effectively computes
.destination
[i] = TTo.CreateTruncating(source
[i])
Applies to
Συνεργαστείτε μαζί μας στο GitHub
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.