dotnet / dotnet/dotnet-api-docs
System.MathF.Abs Max/MinValue relation
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
[The docs](https://docs.microsoft.com/en-us/dotnet/api/system.mathf.abs?view=net-5.0#System_MathF_Abs_System_Single_) claim that
a) The parameter `x` is "A number that is greater than or equal to MinValue, but less than or equal to MaxValue." and
b) The return type to be "A single-precision floating-point number, x, such that 0 ≤ x ≤ MaxValue."
which is just not true.
MathF.Abs allows Positive/NegativeInfinity (and returns PositiveInfinity, as expected) and also accepts NaN where it, as expected, returns NaN, for all three of these both of the conditions are untrue, is this somehow undefined behaviour, or simply a mistake in the docs?
Contributor guide
Assessment
This issue has not been assessed yet.