This commit is contained in:
Miloslav Ciz 2024-03-08 16:56:58 +01:00
parent f920115b91
commit 75f99e7b81
69 changed files with 2008 additions and 1791 deletions

View file

@ -5,7 +5,7 @@ Fixed point arithmetic is a simple and often [good enough](good_enough.md) metho
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.)
- It is **natural, easier to understand and therefore better predictable**, less tricky, [KISS](kiss.md), [suckless](suckless.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.
- 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.
@ -148,4 +148,4 @@ The output is:
8: 2.828
9: 3.000
10: 3.162
```
```