-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
float ranges: mismatch between length and bounds error #329
Comments
There are also corner cases at the other end of the dynamic range:
|
Maybe the fix is to generalize the |
So the solution to this is just to disallow the range
|
I find it highly questionable that range lengths are mapped to |
OK, Float64 ranges (or all ranges) can always have Int64 lengths if you want. I'm worried about the change to Ranges where the step is less than |
Computing the length upon construction might make a lot of sense. I agree that ranges with adjacent elements that are equal are weird, but it seems like the best solution. Making the range
If the length of the former was part of its state, then this could work sanely but copying the length of the range. Maybe we should store the start, step and length or a range instead. I think this came up once before and we felt that keeping the stop value around was a good idea to avoid confusion. But maybe we shouldn't bother and just compute the last value for display and make sure that if a range is input as it is printed, you'll get back the same length range. |
Things are definitely better now. But we still have stuff like
Even with 64-bit lengths, you can't handle everything. I'm not sure it's so bad to use |
Can we close this now? |
Support IndexStyle, IndexLinear, IndexCartesian
I got tricked by my own excitement beginning the julia track. I started solving the Nucleotide Count exercise without a complete reading of its introduction; the comment at the beginning seemed just enough: > count_nucleotides(strand) > The frequency of each nucleotide within `strand` as a dictionary. > Invalid strands raise a `DomainError`. So I read **frequency** and I think: count(nt) / length(strand) It was fun solving that.. Untill the tests revealed my mistake: we are asked to return the count of each nucleotide: not their frequencies. To avoid the confusion -for future students- I'd propose to replace "frequency" with "count" in the comment of the exercise's .jl file.
The text was updated successfully, but these errors were encountered: