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

< and > breaks interval? #566

Closed
Moelf opened this issue Jun 24, 2023 · 2 comments
Closed

< and > breaks interval? #566

Moelf opened this issue Jun 24, 2023 · 2 comments
Labels
1.0 Planned for the major 1.0 release

Comments

@Moelf
Copy link

Moelf commented Jun 24, 2023

julia> f(x) = x>0.5
f (generic function with 1 method)

julia> f(0..1)
false

julia> f(1..2)
true

is this somehow expected according to IEEE?

@OlivierHnt
Copy link
Member

OlivierHnt commented Jun 27, 2023

I believe so; the reference for this is Table 10.3 of the IEEE Standard 1788-2015.

As a side note: inequalities look broken on the 1.0-dev branch

julia> 0..1 > 0.5
true

julia> 0.5 < 0..1
false

@Kolaru
Copy link
Collaborator

Kolaru commented Jun 27, 2023

Currently < implements the strictLess function from the standard, as @OlivierHnt pointed out.

However, the symbol is only a suggestion, so we have the freedom to do whatever we want with it. For interoperability with the julia ecosystem, I think the construct should just error. Otherwise, some julia code silently fails (see #165). It is one of the reason that lead to the creation of NumberIntervals.jl too.

It is one of the things that would be great to have sorted out for 1.0.

So yes, intervals break < and >.

@Kolaru Kolaru added the 1.0 Planned for the major 1.0 release label Jun 27, 2023
@Moelf Moelf closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Planned for the major 1.0 release
Projects
None yet
Development

No branches or pull requests

3 participants