Share via


TensorPrimitives.ConvertToInteger<TFrom,TTo> Method

Definition

Copies source to destination, converting each TFrom value to a TTo integer type using saturation on overflow.

public:
generic <typename TFrom, typename TTo>
 where TFrom : System::Numerics::IFloatingPoint<TFrom> where TTo : System::Numerics::IBinaryInteger<TTo> static void ConvertToInteger(ReadOnlySpan<TFrom> source, Span<TTo> destination);
public static void ConvertToInteger<TFrom,TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination) where TFrom : System.Numerics.IFloatingPoint<TFrom> where TTo : System.Numerics.IBinaryInteger<TTo>;
static member ConvertToInteger : ReadOnlySpan<'From (requires 'From :> System.Numerics.IFloatingPoint<'From>)> * Span<'o (requires 'o :> System.Numerics.IBinaryInteger<'o>)> -> unit (requires 'From :> System.Numerics.IFloatingPoint<'From> and 'o :> System.Numerics.IBinaryInteger<'o>)
Public Shared Sub ConvertToInteger(Of TFrom As IFloatingPoint(Of TFrom), TTo As IFloatingPoint(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.ConvertToInteger(source[i]).

Applies to