Update
This commit is contained in:
parent
aab4692f16
commit
766d037053
26 changed files with 1904 additions and 1802 deletions
|
@ -8,7 +8,11 @@ Fixed point has at least these advantages over floating point:
|
|||
- 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.).
|
||||
- **It is usually well defined**, or at least better than float. While specifics of float -- such as exact precision, rounding rules etc. -- may be unspecified on many systems, with fixed point we usually know the result of any operation, or at least know the tricky cases we have to watch for (such as overflows). If we make an engine using floating point, it may behave differently on a computer that uses a different standard for floating point; with fixed point our engine will behave the same everywhere.
|
||||
- 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.
|
||||
- ...
|
||||
|
||||
What are the disadvantages? Well, we may for example lack precision sometimes, which can manifest e.g. by "jerky" movement in 3D engines, although there are always tricks and ways to fix this (increasing precision, [interpolation](interpolation.md), smoothing filters, ...), although it may sometimes be a bit more complicated. While older/simpler computers will benefit from fixed point, the big/"[modern](modern.md)" computers on the other hand will suffer from it because we'll typically be using our own software implementation which has to compete with hardware accelerated floating point (still, we argue to rather favor the older/simpler computers). Also fixed point won't offer all the comfort that floating point nowadays comes with such as dealing with overflows etc. This is of course not an inherent disadvantage of fixed point but rather the status quo of computing industry, it's because floating point has been pimped and is delivered on a silver platter. In general using fixed point is a bit more [work](work.md): we have to correctly choose the precision, manually adjust order of arithmetic operations, check for/prevent overflows etc., but in the end we get a better program. We have to argue for doing things well rather than quickly.
|
||||
|
||||
## How It Works
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue