Get the absolute value of num.
Perform the binary (two-argument) integer operation specified by op.
Note also:
Like the standard equiavlents, the assignment operators (+=, -=, *=, etc.) take left by ref and will overwrite
it with the result of the operation.
core.bitop.bsf without the undefined behaviour. safeOp.bsf(0) will raise IntFlag.undef.
core.bitop.bsr without the undefined behaviour. safeOp.bsr(0) will raise IntFlag.undef.
Compare left and right using op.
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.
safeOp strives to mimic the standard integer math operations in every way, except:
The runtime error-signalling policy may be selected using the policy template parameter.