Operations<T>.MaxNumber Method

Returns the largest of two numbers, preferring a number over NaN.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.7.0
C#
public static T MaxNumber(
	T a,
	T b
)

Parameters

a  T
 
b  T
 

Return Value

T

Remarks

If exactly one operand is NaN, this method returns the numeric operand. If both operands are NaN, this method returns NaN.

For floating-point values, this method implements IEEE 754-2019 maximumNumber semantics. For zero ties, it returns positive zero when either operand is positive zero.

See Also