|
TinyLine 2D Programming Guide
|
2 Fixed Point NumbersTinyLine 2D uses an efficient fixed-point mathematics. A fixed-point data type is characterized by the word size in bits, the binary point, and whether it is signed or unsigned. The position of the binary point is the means by which fixed-point values are scaled and interpreted. Positive and negative values can also be represented as fixed-point numbers. One bit is used to hold the sign of the number. TinyLine 2D supports fixed point and double fixed-point numbers. It corresponds to FIX_BITS and DFIX_BITS binary point. In other words, fixed-point numbers have FIX_BITS bits fraction length and double fixed-point numbers have DFIX_BITS bits fraction length. Thus, all numbers must be limited in range between -32,767.9999 to +32,767.9999. The Tiny2D class contains methods for performing basic numeric operations with fixed-point precision numbers:
Fixed point arithmetic has advantages and of cause disadvantages as well. Advantages:
Disadvantages:
|
|
© 2008 TinyLine. All rights reserved.
|