Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.07 KB

File metadata and controls

26 lines (18 loc) · 1.07 KB

BitTwiddlingConvenienceFunctions

Stable Dev Build Status Coverage

Useful for going to next/previous mask size, or calculating corresponding shifts:

julia> using BitTwiddlingConvenienceFunctions: prevpow2, nextpow2, intlog2

julia> prevpow2.(7:9)'
1×3 adjoint(::Vector{Int64}) with eltype Int64:
 4  8  8

julia> nextpow2.(7:9)'
1×3 adjoint(::Vector{Int64}) with eltype Int64:
 8  8  16

julia> intlog2.(7:9)' # truncated
1×3 adjoint(::Vector{Int64}) with eltype Int64:
 2  3  3