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

replace and select are insconsistent for integer and digit vector inputs #3

Open
greenflash1357 opened this issue Aug 20, 2015 · 0 comments

Comments

@greenflash1357
Copy link
Owner

Both methods use direct indexing for vectors of digits, i.e. index 1 is the least significant digit.
For integer input, the methods use indexing in direction of reading, i.e. index 1 is the most significant bit.

julia> select(135,[1:2])
13
julia> select(digits(135),[1:2])
2-element Array{Int64,1}:
 5
 3

This can be confusing and misleading, though different behavior for different input parameters might be ok.

Possible future action:

  • leave as is
  • change to consistent behavior, e.g always start indexing from least/most significant digit
  • remove methods for vectors of digits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant