Macros | Functions
p99_arith.h File Reference

Branchless arithmetic and bit twiddling snippets. More...

#include "p99_int.h"
+ Include dependency graph for p99_arith.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define p99_arith_abs(X)   (P99_SIGNED(X) ? p00_arith_abs(X) : P99_RVAL(uintmax_t, (X)))


P99_CONST_FUNCTION uintmax_t p99_arith_log2 (uintmax_t p00_a)
 Computes the floored base-2 logarithm. More...
P99_CONST_FUNCTION intmax_t p99_arith_max (intmax_t p00_a, intmax_t p00_b)
P99_CONST_FUNCTION intmax_t p99_arith_min (intmax_t p00_a, intmax_t p00_b)
P99_CONST_FUNCTION uintmax_t p99_arith_next_pow2 (uintmax_t p00_a)
P99_CONST_FUNCTION uintmax_t p99_arith_prev_pow2 (uintmax_t p00_a)

Detailed Description

Branchless arithmetic and bit twiddling snippets.

Definition in file p99_arith.h.