The decimal point is fixed and doesn't move. They can represent a much wider range of values, but are more complicated to manipulate.įor your second question I'm going to assume you're using fixed-point arithmetic. Floating points are stored using a mantissa and exponent.You also need to track whether the number is a positive-only value, or a 2's complement value. This is sometimes referred to as 12.4, make sure you comment your code to make this clear. For example, you could store a 16-but number, but say the last 4 bits are after the decimal point. The difference is when they are interpreted a decimal point is added at a bit position. They are stored very differently in practice, with fixed-point numbers being much easier to process.įixed point numbers are stored the same as any other integer. One thing to make sure is whether you're dealing with a floating point number, or a fixed-point number.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |