July 2002
Intermediate to advanced
320 pages
8h 15m
English
If your machine does not have an instruction for computing the absolute value, this computation can usually be done in three or four branch-free instructions. First, compute
and then one of the following:

By “2x” we mean, of course, x + x or x << 1.
If you have a fast multiply by a variable whose value is ±1, the following will do:
![]()
Read now
Unlock full access