@@ -49,6 +49,7 @@ public static T Sum<T>(this Span<T> source) where T : INumber<T>
4949 return ReadOnlySpanExtensions . Sum < T > ( source ) ;
5050 }
5151#else
52+
5253#if NET5_0_OR_GREATER
5354
5455 /// <summary>
@@ -61,6 +62,7 @@ public static Half Sum(this Span<Half> source)
6162 {
6263 return ReadOnlySpanExtensions . Sum ( source ) ;
6364 }
65+ #endif
6466
6567 /// <summary>
6668 /// Computes the Sum of all the elements in <paramref name="source"/>.
@@ -193,6 +195,7 @@ public static BigInteger Sum(this Span<BigInteger> source)
193195 return ReadOnlySpanExtensions . Sum ( source ) ;
194196 }
195197#endif
198+
196199 /// <summary>
197200 /// Bypasses a specified number of elements in <paramref name="source"/> and then returns the remaining elements.
198201 /// </summary>
@@ -297,6 +300,7 @@ public static Span<T> TakeLast<T>(this Span<T> source, int count)
297300 }
298301 return source [ ( source . Length - count ) ..] ;
299302 }
303+
300304#if NET7_0_OR_GREATER
301305
302306 /// <summary>
@@ -326,6 +330,7 @@ public static Half Average(this Span<Half> source)
326330 return ReadOnlySpanExtensions . Average ( source ) ;
327331 }
328332#endif
333+
329334 /// <summary>
330335 /// Computes the Average of all the values in <paramref name="source"/>.
331336 /// </summary>
@@ -472,6 +477,7 @@ public static T Min<T>(this Span<T> source) where T : INumber<T>
472477 return ReadOnlySpanExtensions . Min < T > ( source ) ;
473478 }
474479#else
480+
475481#if NET5_0_OR_GREATER
476482
477483 /// <summary>
@@ -485,6 +491,7 @@ public static Half Min(this Span<Half> source)
485491 return ReadOnlySpanExtensions . Min ( source ) ;
486492 }
487493#endif
494+
488495 /// <summary>
489496 /// Computes the Min of all the values in <paramref name="source"/>.
490497 /// </summary>
@@ -616,6 +623,7 @@ public static BigInteger Min(this Span<BigInteger> source)
616623 return ReadOnlySpanExtensions . Min ( source ) ;
617624 }
618625#endif
626+
619627#if NET7_0_OR_GREATER
620628
621629 /// <summary>
@@ -630,6 +638,7 @@ public static T Max<T>(this Span<T> source) where T : INumber<T>
630638 return ReadOnlySpanExtensions . Max < T > ( source ) ;
631639 }
632640#else
641+
633642#if NET5_0_OR_GREATER
634643
635644 /// <summary>
@@ -643,6 +652,7 @@ public static Half Max(this Span<Half> source)
643652 return ReadOnlySpanExtensions . Max ( source ) ;
644653 }
645654#endif
655+
646656 /// <summary>
647657 /// Computes the Max of all the values in <paramref name="source"/>.
648658 /// </summary>
@@ -774,6 +784,5 @@ public static BigInteger Max(this Span<BigInteger> source)
774784 return ReadOnlySpanExtensions . Max ( source ) ;
775785 }
776786#endif
777-
778787 }
779788}
0 commit comments