Get the absolute value of num. Because the return type is always unsigned, overflow is not possible.
Perform the binary (two-argument) integer operation specified by op.
core.bitop.bsf without the undefined behaviour. smartOp.bsf(0) will raise IntFlag.undef.
core.bitop.bsr without the undefined behaviour. smartOp.bsr(0) will raise IntFlag.undef.
Compare left and right using op.
Direct comparisons between boolean values and numeric ones are forbidden. Make the intent explicit:
Defines a total order on all basic scalar values, using the same rules as std.math.cmp().
Equivalent to left / pow(2, exp), but faster and works with a wider range of inputs. This is a safer alternative to left >> exp that is still very fast.
Get the base 2 logarithm of abs(num), rounded down to the nearest integer.
Equivalent to left % pow(2, exp), but faster and works with a wider range of inputs. This is a safer alternative to left & ((1 << exp) - 1) that is still very fast.
Equivalent to left * pow(2, exp), but faster and works with a wider range of inputs. This is a safer alternative to left << exp that is still very fast.
Raise base to the exp power.
Perform the unary (single-argument) integer operation specified by op.
Implements various integer math operations with error checking.
smartOp strives to give the mathematically correct result, with integer-style rounding, for all inputs. Only if the correct result is undefined or not representable by the return type is an error signalled, using checkedint.flags.
The error-signalling policy may be selected using the policy template parameter.