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

Define x // 3 for an interval x #670

Closed
dpsanders opened this issue Jun 4, 2024 · 2 comments
Closed

Define x // 3 for an interval x #670

dpsanders opened this issue Jun 4, 2024 · 2 comments

Comments

@dpsanders
Copy link
Member

ff(x) = x // 3

ff(1..2)

gives

ERROR: MethodError: no method matching //(::Interval{Float64}, ::Int64)
@dpsanders
Copy link
Member Author

dpsanders commented Jun 4, 2024

Similarly for

ff(x) = x // interval(3)

@OlivierHnt
Copy link
Member

This was done on purpose because // is a constructor for the Rational type.

This is consistent with eg

julia> 1.0//1
ERROR: MethodError: no method matching //(::Float64, ::Int64)

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