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
Some operations on complement bitsets are wrong #5480
Labels
type.review
Ticket describes a possible improvement.
Comments
hiiamboris
added
the
type.bug
Ticket describes an abnormal behavior, not conforming to the specs or expectation.
label
Feb 13, 2024
The length of the bitset should be taken into account.
|
No it's not correct. Length is just an internal implementation detail. Implementation should not drive the design. Design should drive the implementation. |
General rules for bitsets should be:
Current builds of Red, R3 and Ren-C I have all fail the bitset math. @Oldes @hostilefork FYI. |
dockimbel
added
type.review
Ticket describes a possible improvement.
and removed
type.bug
Ticket describes an abnormal behavior, not conforming to the specs or expectation.
labels
Feb 16, 2024
dockimbel
changed the title
Bitsets operations are completely wrong
Some negative bitsets operations are wrong
Feb 25, 2024
dockimbel
changed the title
Some negative bitsets operations are wrong
Some complement bitsets operations are wrong
Feb 25, 2024
dockimbel
changed the title
Some complement bitsets operations are wrong
Some operations on complement bitsets are wrong
Feb 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Using helper func for visualization:
base2: func [bs] [s: copy {} repeat i 24 [append s pick "10" on = find bs i - 1] insert skip insert skip s 8 "." 8 "." s]
base2 c1: charset [0 - 15]
"11111111.11111111.00000000"
"11111111.11111111.00000000"
base2 c2: charset [not 1 - 6]
"10000001.11111111.11111111"
"10000001.11111111.11111111"
base2 exclude c1 c2
"01111110.11111111.11111111"
"01111110.00000000.00000000"
base2 exclude c2 c1
"00000000.00000000.11111111"
"00000000.00000000.11111111"
base2 union c1 c2
"11111111.11111111.11111111"
"11111111.11111111.11111111"
base2 c1 or c2
"11111111.11111111.11111111"
"11111111.11111111.11111111"
base2 intersect c1 c2
"10000001.00000000.11111111"
"10000001.11111111.00000000"
base2 c1 and c2
"10000001.11111111.11111111"
"10000001.11111111.00000000"
base2 difference c1 c2
"01111110.11111111.11111111"
"01111110.00000000.11111111"
base2 c1 xor c2
"01111110.11111111.11111111"
"01111110.00000000.11111111"
To reproduce
Platform version
The text was updated successfully, but these errors were encountered: