BitTwiddlingConvenienceFunctions.jl

Bit twiddling convenience functions.
Author JuliaSIMD
Popularity
3 Stars
Updated Last
6 Months Ago
Started In
August 2021

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