Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of `isreal` is incorrect for Inf and NaN #24870

Closed
dpsanders opened this issue Nov 30, 2017 · 5 comments

Comments

5 participants
@dpsanders
Copy link
Contributor

commented Nov 30, 2017

help?> isreal

  isreal(x) -> Bool

  Test whether x or all its elements are numerically equal to some real
  number.

But

julia> isreal(Inf)
true

julia> isreal(NaN)
true

Neither Inf nor NaN is "numerically equal to a real number".

@dpsanders dpsanders changed the title Documentation of `isreal` is incorrect Documentation of `isreal` is incorrect for Inf and NaN Nov 30, 2017

@dpsanders

This comment has been minimized.

Copy link
Contributor Author

commented Nov 30, 2017

(I was looking for isfinite and thought isreal would behave the same.)

@StefanKarpinski

This comment has been minimized.

Copy link
Member

commented Dec 3, 2017

I would argue that Inf is an extended real number so that's probably ok, but NaN might be considered non-real. It's unclear to me if that's a helpful definition or not though.

@Subhash-Saurabh

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2017

I am new to julia and I want to work on this. Can anyone tell me what exactly needs to be done.

@andreasnoack

This comment has been minimized.

Copy link
Member

commented Dec 10, 2017

@Subhash-Saurabh You could open a PR that adds a the uncontroversial NaN check to isreal and as well as tests. Then we can continue the discussion of Inf in your PR.

@StefanKarpinski

This comment has been minimized.

Copy link
Member

commented Dec 10, 2017

The current definition has the benefit of always being true for subtypes of Real. I'm not actually sure that we want to change that – I suspect that the best course of action here is just to fix the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.