Unsigned fraction of turn In this system, an angle is represented by an
n-
bit unsigned binary number in the sequence 0, ..., 2
n−1 that is interpreted as a multiple of 1/2
n of a full turn; that is, 360/2
n degrees or 2π/2
n radians. The number can also be interpreted as a fraction of a full turn between 0 (inclusive) and 1 (exclusive) represented in binary fixed-point format with a scaling factor of 1/2
n. Multiplying that fraction by 360° or 2π gives the angle in
degrees in the range 0 to 360, or in
radians, in the range 0 to 2π, respectively. For example, with , the binary integers 000000002 (0.00), 010000002 (0.25), 100000002 (0.50), and 110000002 (0.75) represent the angular measures 0°, 90°, 180°, and 270°, respectively. The main advantage of this system is that the addition or subtraction of the integer numeric values with the
n-bit arithmetic used in most computers produces results that are consistent with the geometry of angles. Namely, the integer result of the operation is automatically reduced
modulo 2
n, matching the fact that angles that differ by an integer number of full turns are equivalent. Thus one does not need to explicitly test or handle the wrap-around, as one must do when using other representations (such as number of degrees or radians in floating-point). It is slightly less than 20
arcseconds.
Signed fraction of turn 32-bit BAM. In this figure the 32-bit binary integers are interpreted as signed binary fixed-point values with scaling factor 2−31, representing fractions between −1.0 (inclusive) and +1.0 (exclusive). Alternatively, the same
n bits can also be interpreted as a signed integer in the range −2
n−1, ..., 2
n−1−1 in the
two's complement convention. They can also be interpreted as a fraction of a full turn between −0.5 (inclusive) and +0.5 (exclusive) in signed fixed-point format, with the same scaling factor; or a fraction of half-turn between −1.0 (inclusive) and +1.0 (exclusive) with scaling factor 1/2
n−1. Either way, these numbers can then be interpreted as angles between −180° (inclusive) and +180° (exclusive), with −0.25 meaning −90° and +0.25 meaning +90°. The result of adding or subtracting the numerical values will have the same sign as the result of adding or subtracting angles, once reduced to this range. This interpretation eliminates the need to reduce angles to the range when computing
trigonometric functions. == Example ==