bitfield: has depends on the order of invalid and set indices
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- data
Research direction
Start with the has method and the get_bit helper in the bitfield module, which the issue says treats out-of-range positions as zero. Run the two-line repro from the issue (bitfield.from_str('00100') with has(-1, 2) and has(2, -1)) to confirm the order-dependent results. Done when both argument orders return the same answer and the result matches the rule that each position is checked independently.
Written by the indexing model from the issue text.
Description
On dev at a1342333f2, run this with ./v -gc none run repro.v:
import bitfield
fn main() {
bf := bitfield.from_str('00100')
println(bf.has(-1, 2))
println(bf.has(2, -1))
}
The first query reports false and the reversed query reports true. Both ask whether any of the same positions is set. Position 2 is set, and get_bit treats an out-of-range position as zero. has should apply that rule to each requested position.
[!NOTE]
You can use the 👍 reaction to increase the issue's priority for developers.Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
- Dominant language
- V
- Stars
- 38.1k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 682
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vlang/v
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
Similar issues
-
MeaningsTables are dropped on read from MotionSVDMasksPossibly taken @bendichter claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Add all-cssOpennew spec review
Difficulty 1/5 Under an hour Newbie friendliness 70/100
w3c/browser-specs#2729 · 1 comment ·
Maintainers usually reply within 1 day
-
approved correction metadata pending
Difficulty 1/5 Under an hour Newbie friendliness 70/100
acl-org/acl-anthology#11061 · 2 comments ·
Maintainers usually reply within 1 day
-
`TezosTzktDatasource.iter_transactions` drops the address filter and the level rangePossibly taken @Xnadir claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
NamingOpen
Difficulty 1/5 Under an hour Newbie friendliness 75/100
DuarteSantos8/openGym#1502 ·
Maintainers usually reply within 2 days