Skip to content

System.Double.IsRealNumber(System.Double.PositiveInfinity) is true #103930

@Smaug123

Description

@Smaug123

Description

This seems so deeply unintuitive that I can only imagine it to be a bug.

To be concrete, this function is documented as follows: "Determines if a value represents a real number." I am not aware of any formulations of the reals in which $\infty$ is a real number. (Certainly "Dedekind cuts of the rationals" and "Cauchy completions of rational sequences", as well as Tarski's axiomatization, all do not admit infinite reals.)

Reproduction Steps

$ dotnet fsi
> System.Double.IsRealNumber(System.Double.PositiveInfinity);;

Expected behavior

$ dotnet fsi
> System.Double.IsRealNumber(System.Double.PositiveInfinity);;
val it: bool = false

Actual behavior

$ dotnet fsi
> System.Double.IsRealNumber(System.Double.PositiveInfinity);;
val it: bool = true

Regression?

It's always been this way, ever since it was introduced in #69651 .

Known Workarounds

I believe IsFinite is a correct implementation of IsRealNumber.

Configuration

SDK 8.0.301.

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.NumericsdocumentationDocumentation bug or enhancement, does not impact product or test codehelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions