===Unsigned fraction of turn===
In this system, an angle is represented by an ''n''-[[bit]] unsigned binary number in the rangesequence {0, ..., 2<sup>''n''</sup>−1} that is interpreted as an multiple of 1/2<sup>''n''</sup> of a full turn; that is, 360/2<sup>''n''</sup> degrees or 2π/2<sup>''n''</sup> 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<sup>''n''</sup>. Multiplying that fraction by 360° or 2π gives the angle in [[degree (angle)|degree]]s in the range 0 to 360, or in [[radian]]s, in the range 0 to 2π, respectively.
For example, with ''n'' = 8, the binary integers (00000000)<sub>2</sub> (fraction 0.00), (01000000)<sub>2</sub> (0.25), (10000000)<sub>2</sub> (0.50), and (11000000)<sub>2</sub> (0.75) represent the angular measures 0°, 90°, 180°, and 270°, respectively.
===Signed fraction of turn===
Alternatively, the same ''n'' bits can also be interpreted as a signed integer in the range {−2<sup>''n''−1</sup>, ..., 2<sup>''n''−1</sup>-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<sup>''n''−1</sup>.
Either way, these numbers can then be interpreted as angles between -180−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 [{{closed-closed|−π, +π]}} when computing [[trigonometric functions]].
==See also==
|