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

bisect fails for infinite interval #243

Closed
dpsanders opened this issue Mar 6, 2017 · 4 comments
Closed

bisect fails for infinite interval #243

dpsanders opened this issue Mar 6, 2017 · 4 comments

Comments

@dpsanders
Copy link
Member

dpsanders commented Mar 6, 2017

julia> x = y = -..∞
[-∞, ∞]

julia> X = x × y
[-∞, ∞] × [-∞, ∞]

julia> bisect(X)
([NaN, NaN] × [-∞, ∞],[NaN, NaN] × [-∞, ∞])

Although it's not clear that this is actually a useful thing to do.

@dpsanders
Copy link
Member Author

Nor is it clear what the correct bisection of a semi-infinite interval would mean. Maybe just throw an error?

An alternative is to have a way to just shave off infinity from the interval to leave a finite one.

1 similar comment
@dpsanders
Copy link
Member Author

Nor is it clear what the correct bisection of a semi-infinite interval would mean. Maybe just throw an error?

An alternative is to have a way to just shave off infinity from the interval to leave a finite one.

@lbenet
Copy link
Member

lbenet commented Mar 12, 2017

I think the reason bisect fails is because it does not check if the interval is unbounded or empty; see mid for reference.

As a side remark, I just noticed that in the standard table 10.2 (page 39) states that mid is defined as "no value" for an empty or unbounded interval. Yet, in page 64 it states that for the interval [-∞, ∞] it should return 0 (as we do), but for intervals like [-∞,x] with finite x it should return the "finite largest T number of largest maginitude", i.e., nextfloat(-Inf), and something alike for [x,∞]; we don't follow this, and i think there is no test in the ITF1788 suite that checks this.

@dpsanders
Copy link
Member Author

Yes, you're right. I'll change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants