This commit is contained in:
Miloslav Ciz 2023-10-30 21:42:20 +01:00
parent 5414a07fa2
commit c25381cf0e
9 changed files with 38 additions and 21 deletions

View file

@ -7,7 +7,8 @@ Fixed point has at least these advantages over floating point:
- **It doesn't require a special hardware coprocessor** for efficient execution and so doesn't introduce a [dependency](dependency.md). Programs using floating point will run extremely slowly on systems without float hardware support as they have to emulate the complex hardware in software, while fixed point will run just as fast as integer arithmetic. For this reason fixed point is very often used in [embedded](embedded.md) computers.
- It is **natural, easier to understand and therefore better predictable**, less tricky, [KISS](kiss.md), [suckless](sukless.md). (Float's IEEE 754 standard is 58 pages long, the paper *What Every Computer Scientist Should Know About Floating-Point Arithmetic* has 48 pages.)
- Is easier to implement and so **supported in many more systems**. Any language or format supporting integers also supports fixed point.
- Isn't ugly and in [two's complement](twos_complement.md) **doesn't waste values** (unlike IEEE 754 with positive and negative zero, denormalized numbers, many [NaNs](nan.md) etc.).
- It isn't ugly and in [two's complement](twos_complement.md) **doesn't waste values** (unlike IEEE 754 with positive and negative zero, denormalized numbers, many [NaNs](nan.md) etc.).
- Some simpler (i.e. better) programming languages such as [comun](comun.md) don't support float at all, while fixed point can be used in any language that supports integers.
## How It Works