For example, in the following code, a BitArray that is constructed from an input array of values that are all false is found to contain some values that are true:
julia> using OffsetArrays
julia> all_false = falses(-1000:1000);
julia> any(==(true), all_false)
false
julia> all_false_bitarray = BitArray(all_false);
julia> any(==(true), all_false_bitarray)
true
This is due to the code here, which applies @inbounds to a loop before proceeding to index the user-provided array with indices that start from one.
|
@inbounds begin |
|
for i = 1:length(Bc)-1 |
|
c = UInt64(0) |
|
for j = 0:63 |
|
c |= (UInt64(convert(Bool, A[ind])::Bool) << j) |
For example, in the following code, a
BitArraythat is constructed from an input array of values that are allfalseis found to contain some values that aretrue:This is due to the code here, which applies
@inboundsto a loop before proceeding to index the user-provided array with indices that start from one.julia/base/bitarray.jl
Lines 510 to 514 in 2168230