Partager via


TensorPrimitives.ConvertTruncating<TFrom,TTo> Méthode

Définition

Copie source en destination, en convertissant chaque valeur de TFrom en valeur de TTo.

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))

Paramètres de type

TFrom
TTo

Paramètres

source
ReadOnlySpan<TFrom>

Étendue source à partir de laquelle copier des valeurs.

destination
Span<TTo>

Étendue de destination dans laquelle les valeurs converties doivent être écrites.

Exceptions

La destination est trop courte.

Remarques

Cette méthode calcule efficacement destination[i] = TTo.CreateTruncating(source[i]).

S’applique à