Comparteix a través de


TensorPrimitives.ConvertTruncating<TFrom,TTo> Método

Definición

Copia source en destination, convirtiendo cada valor de TFrom en un valor 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))

Parámetros de tipo

TFrom
TTo

Parámetros

source
ReadOnlySpan<TFrom>

Intervalo de origen desde el que se van a copiar los valores.

destination
Span<TTo>

Intervalo de destino en el que se deben escribir los valores convertidos.

Excepciones

El destino es demasiado corto.

Comentarios

Este método calcula eficazmente destination[i] = TTo.CreateTruncating(source[i]).

Se aplica a