Template Function intnat::condSubNoCmp

Function Documentation

template<typename NInt>
static inline NInt intnat::condSubNoCmp(NInt v, NInt q)

Conditional subtraction v >= q ? v - q : v computed without a branch, for v < 2q.

Parameters
  • v – is the value to reduce.

  • q – is the modulus.

Returns

v reduced into [0, q).