nxt.math_ex

Members

Functions

isPow2
bool isPow2(T x)
isPow2A
bool isPow2A(T x)
isPow2B
bool isPow2B(T x)

Check if x is an exact (binary) power of 2. * * See_Also: http://forum.dlang.org/thread/zumhmosfkvwjymjhmtlt@forum.dlang.org#post-fvnmurrctavpfkunssdf:40forum.dlang.org * See_Also: http://forum.dlang.org/post/hloonbgclzloqemycnth@forum.dlang.org

isPow2E
bool isPow2E(T x)
isPow2F
bool isPow2F(T x)

ditto, avoids a jump instruction.

isPow2fast
bool isPow2fast(T x)

Check if x is an exact (binary) power of 2, except when x is zero then * zero is returned. * * See_Also: http://forum.dlang.org/thread/zumhmosfkvwjymjhmtlt@forum.dlang.org#post-fvnmurrctavpfkunssdf:40forum.dlang.org * See_Also: http://forum.dlang.org/post/hloonbgclzloqemycnth@forum.dlang.org

Meta