following code:
if i try to shift 28 bits, it works, but doesnt take the last 4 positions as i shift 28
if i try to shift 32 bits, the result of nodeword is 1, whatever condition found
long is 8 bytes, so it should work.
is this a bug in b4j? or limitation of shift?
result of logdump
at x=8 the result is 8388608, 1 bit missing, not inserted (at x=1 a '1' is inserted, at x=8 a ''1'' is inserted, at x=11 a "1' is inserted, but those are not shifted in anymore
update Cangroup
inserted:1-nw:-2147483648
inserted: 0-nw:-1073741824
inserted: 0-nw:-536870912
inserted: 0-nw:-268435456
inserted: 0-nw:-134217728
inserted: 0-nw:-67108864
inserted: 0-nw:-33554432
inserted: 0-nw:-16777216
inserted:1-nw:-8388608
inserted: 0-nw:-4194304
inserted: 0-nw:-2097152
inserted:1-nw:-1048576
inserted: 0-nw:-524288
inserted:1-nw:-262144
inserted:1-nw:-131072
inserted: 0-nw:-65536
inserted: 0-nw:-32768
inserted: 0-nw:-16384
inserted: 0-nw:-8192
inserted: 0-nw:-4096
inserted: 0-nw:-2048
inserted: 0-nw:-1024
inserted: 0-nw:-512
inserted: 0-nw:-256
inserted: 0-nw:-128
inserted: 0-nw:-64
inserted: 0-nw:-32
inserted: 0-nw:-16
inserted: 0-nw:-8
inserted: 0-nw:-4
inserted: 0-nw:-2
inserted: 0-nw:-1
same when i inserted all "1'"
inserted:1-nw:-2147483648
inserted:1-nw:-1073741824
inserted:1-nw:-536870912
inserted:1-nw:-268435456
inserted:1-nw:-134217728
inserted:1-nw:-67108864
inserted:1-nw:-33554432
inserted:1-nw:-16777216
inserted:1-nw:-8388608
inserted:1-nw:-4194304
inserted:1-nw:-2097152
inserted:1-nw:-1048576
inserted:1-nw:-524288
inserted:1-nw:-262144
inserted:1-nw:-131072
inserted:1-nw:-65536
inserted:1-nw:-32768
inserted:1-nw:-16384
inserted:1-nw:-8192
inserted:1-nw:-4096
inserted:1-nw:-2048
inserted:1-nw:-1024
inserted:1-nw:-512
inserted:1-nw:-256
inserted:1-nw:-128
inserted:1-nw:-64
inserted:1-nw:-32
inserted:1-nw:-16
inserted:1-nw:-8
inserted:1-nw:-4
inserted:1-nw:-2
inserted:1-nw:-1
B4X:
Dim nodeword=0 As Long
For x=1 To 32
nodeword=Bit.Shiftright(nodeword,1)
If nodevalues(x).Status>0 Then
nodeword=Bit.Or(nodeword,0x80000000)
Log(nodevalues(x).Name & " 1-" & "nw:"& nodeword)
Else
Log (nodevalues(x).Name & " 0-"& "nw:" & nodeword)
End If
Next
if i try to shift 32 bits, the result of nodeword is 1, whatever condition found
long is 8 bytes, so it should work.
is this a bug in b4j? or limitation of shift?
result of logdump
at x=8 the result is 8388608, 1 bit missing, not inserted (at x=1 a '1' is inserted, at x=8 a ''1'' is inserted, at x=11 a "1' is inserted, but those are not shifted in anymore
update Cangroup
inserted:1-nw:-2147483648
inserted: 0-nw:-1073741824
inserted: 0-nw:-536870912
inserted: 0-nw:-268435456
inserted: 0-nw:-134217728
inserted: 0-nw:-67108864
inserted: 0-nw:-33554432
inserted: 0-nw:-16777216
inserted:1-nw:-8388608
inserted: 0-nw:-4194304
inserted: 0-nw:-2097152
inserted:1-nw:-1048576
inserted: 0-nw:-524288
inserted:1-nw:-262144
inserted:1-nw:-131072
inserted: 0-nw:-65536
inserted: 0-nw:-32768
inserted: 0-nw:-16384
inserted: 0-nw:-8192
inserted: 0-nw:-4096
inserted: 0-nw:-2048
inserted: 0-nw:-1024
inserted: 0-nw:-512
inserted: 0-nw:-256
inserted: 0-nw:-128
inserted: 0-nw:-64
inserted: 0-nw:-32
inserted: 0-nw:-16
inserted: 0-nw:-8
inserted: 0-nw:-4
inserted: 0-nw:-2
inserted: 0-nw:-1
same when i inserted all "1'"
inserted:1-nw:-2147483648
inserted:1-nw:-1073741824
inserted:1-nw:-536870912
inserted:1-nw:-268435456
inserted:1-nw:-134217728
inserted:1-nw:-67108864
inserted:1-nw:-33554432
inserted:1-nw:-16777216
inserted:1-nw:-8388608
inserted:1-nw:-4194304
inserted:1-nw:-2097152
inserted:1-nw:-1048576
inserted:1-nw:-524288
inserted:1-nw:-262144
inserted:1-nw:-131072
inserted:1-nw:-65536
inserted:1-nw:-32768
inserted:1-nw:-16384
inserted:1-nw:-8192
inserted:1-nw:-4096
inserted:1-nw:-2048
inserted:1-nw:-1024
inserted:1-nw:-512
inserted:1-nw:-256
inserted:1-nw:-128
inserted:1-nw:-64
inserted:1-nw:-32
inserted:1-nw:-16
inserted:1-nw:-8
inserted:1-nw:-4
inserted:1-nw:-2
inserted:1-nw:-1