다음을 통해 공유


TensorPrimitives.ConvertTruncating<TFrom,TTo> 메서드

정의

TFrom 값을 TTo 값으로 변환하여 destinationsource 복사합니다.

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

형식 매개 변수

TFrom
TTo

매개 변수

source
ReadOnlySpan<TFrom>

값을 복사할 원본 범위입니다.

destination
Span<TTo>

변환된 값을 작성해야 하는 대상 범위입니다.

예외

대상이 너무 짧습니다.

설명

이 메서드는 destination[i] = TTo.CreateTruncating(source[i])효과적으로 계산합니다.

적용 대상