From 96ae7cfefb0ae0ad621edc56bf690da174d9c7ab Mon Sep 17 00:00:00 2001 From: delreluca <35895923+delreluca@users.noreply.github.com> Date: Sun, 17 Nov 2024 02:23:11 +0100 Subject: [PATCH] `TensorPrimitives` XML docs: `MinNumber`/`ReciprocalSqrt`/`ReciprocalSqrtEstimate` oversights (#109889) * Fix XML docs for `MinNumber` They ware accidentally referring to maxima * Add `T.Sqrt` to XML docs of reciprocal square root The effective code was copied from the other reciprocal --- .../Tensors/netcore/TensorPrimitives.MinNumber.cs | 14 +++++++------- .../Tensors/netcore/TensorPrimitives.Reciprocal.cs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MinNumber.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MinNumber.cs index 653e8c7383eae..8383efdebb884 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MinNumber.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MinNumber.cs @@ -11,13 +11,13 @@ namespace System.Numerics.Tensors { public static partial class TensorPrimitives { - /// Searches for the largest number in the specified tensor. + /// Searches for the smallest number in the specified tensor. /// The tensor, represented as a span. - /// The maximum element in . + /// The minimum element in . /// Length of must be greater than zero. /// /// - /// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. Positive 0 is considered greater than negative 0. + /// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. Positive 0 is considered greater than negative 0. /// /// /// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different @@ -28,7 +28,7 @@ public static T MinNumber(ReadOnlySpan x) where T : INumber => MinMaxCore>(x); - /// Computes the element-wise maximum of the numbers in the specified tensors. + /// Computes the element-wise minimum of the numbers in the specified tensors. /// The first tensor, represented as a span. /// The second tensor, represented as a span. /// The destination tensor, represented as a span. @@ -41,7 +41,7 @@ public static T MinNumber(ReadOnlySpan x) /// This method effectively computes [i] = .MinNumber([i], [i]). /// /// - /// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is + /// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is /// the other is returned. Positive 0 is considered greater than negative 0. /// /// @@ -53,7 +53,7 @@ public static void MinNumber(ReadOnlySpan x, ReadOnlySpan y, Span de where T : INumber => InvokeSpanSpanIntoSpan>(x, y, destination); - /// Computes the element-wise maximum of the numbers in the specified tensors. + /// Computes the element-wise minimum of the numbers in the specified tensors. /// The first tensor, represented as a span. /// The second tensor, represented as a scalar. /// The destination tensor, represented as a span. @@ -64,7 +64,7 @@ public static void MinNumber(ReadOnlySpan x, ReadOnlySpan y, Span de /// This method effectively computes [i] = .MinNumber([i], ). /// /// - /// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is + /// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is /// the other is returned. Positive 0 is considered greater than negative 0. /// /// diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Reciprocal.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Reciprocal.cs index 16d0df26157cb..2c348a4cd28d9 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Reciprocal.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Reciprocal.cs @@ -47,7 +47,7 @@ public static void ReciprocalEstimate(ReadOnlySpan x, Span destination) /// is an integer type and an element in is equal to zero. /// /// - /// This method effectively computes [i] = 1 / [i]. + /// This method effectively computes [i] = 1 / T.Sqrt([i]). /// /// public static void ReciprocalSqrt(ReadOnlySpan x, Span destination) @@ -62,7 +62,7 @@ public static void ReciprocalSqrt(ReadOnlySpan x, Span destination) /// is an integer type and an element in is equal to zero. /// /// - /// This method effectively computes [i] = 1 / [i]. + /// This method effectively computes [i] = 1 / T.Sqrt([i]). /// /// public static void ReciprocalSqrtEstimate(ReadOnlySpan x, Span destination)