Skip to content

Commit 9701fe0

Browse files
[release/9.0-staging] TensorPrimitives XML docs: MinNumber/ReciprocalSqrt/ReciprocalSqrtEstimate oversights (#109922)
* 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 --------- Co-authored-by: delreluca <[email protected]> Co-authored-by: Luca Del Re <[email protected]>
1 parent 3d448d1 commit 9701fe0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.MinNumber.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ namespace System.Numerics.Tensors
1111
{
1212
public static partial class TensorPrimitives
1313
{
14-
/// <summary>Searches for the largest number in the specified tensor.</summary>
14+
/// <summary>Searches for the smallest number in the specified tensor.</summary>
1515
/// <param name="x">The tensor, represented as a span.</param>
16-
/// <returns>The maximum element in <paramref name="x"/>.</returns>
16+
/// <returns>The minimum element in <paramref name="x"/>.</returns>
1717
/// <exception cref="ArgumentException">Length of <paramref name="x" /> must be greater than zero.</exception>
1818
/// <remarks>
1919
/// <para>
20-
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. Positive 0 is considered greater than negative 0.
20+
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. Positive 0 is considered greater than negative 0.
2121
/// </para>
2222
/// <para>
2323
/// 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<T>(ReadOnlySpan<T> x)
2828
where T : INumber<T> =>
2929
MinMaxCore<T, MinNumberOperator<T>>(x);
3030

31-
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
31+
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
3232
/// <param name="x">The first tensor, represented as a span.</param>
3333
/// <param name="y">The second tensor, represented as a span.</param>
3434
/// <param name="destination">The destination tensor, represented as a span.</param>
@@ -41,7 +41,7 @@ public static T MinNumber<T>(ReadOnlySpan<T> x)
4141
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />[i])</c>.
4242
/// </para>
4343
/// <para>
44-
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
44+
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
4545
/// the other is returned. Positive 0 is considered greater than negative 0.
4646
/// </para>
4747
/// <para>
@@ -53,7 +53,7 @@ public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> de
5353
where T : INumber<T> =>
5454
InvokeSpanSpanIntoSpan<T, MinNumberOperator<T>>(x, y, destination);
5555

56-
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
56+
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
5757
/// <param name="x">The first tensor, represented as a span.</param>
5858
/// <param name="y">The second tensor, represented as a scalar.</param>
5959
/// <param name="destination">The destination tensor, represented as a span.</param>
@@ -64,7 +64,7 @@ public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> de
6464
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />)</c>.
6565
/// </para>
6666
/// <para>
67-
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
67+
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
6868
/// the other is returned. Positive 0 is considered greater than negative 0.
6969
/// </para>
7070
/// <para>

src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.Reciprocal.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static void ReciprocalEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)
4747
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
4848
/// <remarks>
4949
/// <para>
50-
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
50+
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
5151
/// </para>
5252
/// </remarks>
5353
public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
@@ -62,7 +62,7 @@ public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
6262
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
6363
/// <remarks>
6464
/// <para>
65-
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
65+
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
6666
/// </para>
6767
/// </remarks>
6868
public static void ReciprocalSqrtEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)

0 commit comments

Comments
 (0)