Share via


TensorPrimitives.Round Method

Definition

Overloads

Round<T>(ReadOnlySpan<T>, Span<T>)

Computes the element-wise rounding of the numbers in the specified tensor

Round<T>(ReadOnlySpan<T>, Int32, Span<T>)

Computes the element-wise rounding of the numbers in the specified tensor

Round<T>(ReadOnlySpan<T>, MidpointRounding, Span<T>)

Computes the element-wise rounding of the numbers in the specified tensor

Round<T>(ReadOnlySpan<T>, Int32, MidpointRounding, Span<T>)

Computes the element-wise rounding of the numbers in the specified tensor

Round<T>(ReadOnlySpan<T>, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

Computes the element-wise rounding of the numbers in the specified tensor

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Round(ReadOnlySpan<T> x, Span<T> destination);
public static void Round<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Round : ReadOnlySpan<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> * Span<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> -> unit (requires 'T :> System.Numerics.IFloatingPoint<'T>)
Public Shared Sub Round(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = T.Round(x[i]).

Applies to

Round<T>(ReadOnlySpan<T>, Int32, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

Computes the element-wise rounding of the numbers in the specified tensor

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Round(ReadOnlySpan<T> x, int digits, Span<T> destination);
public static void Round<T> (ReadOnlySpan<T> x, int digits, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Round : ReadOnlySpan<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> * int * Span<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> -> unit (requires 'T :> System.Numerics.IFloatingPoint<'T>)
Public Shared Sub Round(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), digits As Integer, destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

digits
Int32

The number of fractional digits to which the numbers in x should be rounded.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = T.Round(x[i], digits).

Applies to

Round<T>(ReadOnlySpan<T>, MidpointRounding, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

Computes the element-wise rounding of the numbers in the specified tensor

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Round(ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination);
public static void Round<T> (ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Round : ReadOnlySpan<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> * MidpointRounding * Span<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> -> unit (requires 'T :> System.Numerics.IFloatingPoint<'T>)
Public Shared Sub Round(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), mode As MidpointRounding, destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

mode
MidpointRounding

The mode under which x should be rounded.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

x and destination reference overlapping memory locations and do not begin at the same location.

Remarks

This method effectively computes destination[i] = T.Round(x[i], mode).

Applies to

Round<T>(ReadOnlySpan<T>, Int32, MidpointRounding, Span<T>)

Source:
TensorPrimitives.Round.cs
Source:
TensorPrimitives.Round.cs

Computes the element-wise rounding of the numbers in the specified tensor

public:
generic <typename T>
 where T : System::Numerics::IFloatingPoint<T> static void Round(ReadOnlySpan<T> x, int digits, MidpointRounding mode, Span<T> destination);
public static void Round<T> (ReadOnlySpan<T> x, int digits, MidpointRounding mode, Span<T> destination) where T : System.Numerics.IFloatingPoint<T>;
static member Round : ReadOnlySpan<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> * int * MidpointRounding * Span<'T (requires 'T :> System.Numerics.IFloatingPoint<'T>)> -> unit (requires 'T :> System.Numerics.IFloatingPoint<'T>)
Public Shared Sub Round(Of T As IFloatingPoint(Of T)) (x As ReadOnlySpan(Of T), digits As Integer, mode As MidpointRounding, destination As Span(Of T))

Type Parameters

T

Parameters

x
ReadOnlySpan<T>

The tensor, represented as a span.

digits
Int32

The number of fractional digits to which the numbers in x should be rounded.

mode
MidpointRounding

The mode under which x should be rounded.

destination
Span<T>

The destination tensor, represented as a span.

Exceptions

mode is invalid.

digits is invalid.

Remarks

This method effectively computes destination[i] = T.Round(x[i], digits, mode).

Applies to