189
edits
Line 640: | Line 640: | ||
==== Roundoff problems with textranslate step and scroll. ==== | ==== Roundoff problems with textranslate step and scroll. ==== | ||
The textranslate | The textranslate animation is delightful for 3D animation | ||
of mechanical drum-type displays as on old-fashioned | of mechanical drum-type displays as on old-fashioned | ||
odometers and Hobbs meters. | odometers and Hobbs meters. | ||
Line 646: | Line 646: | ||
It is not, however, a convenient way to implement digital | It is not, however, a convenient way to implement digital | ||
readouts. It works OK for integers, but the code in | readouts. It works OK for integers, but the code in | ||
apply_mod() suffers from | apply_mod() suffers from roundoff errors when dealing with decimal fractions, such as the ".1" in 122.1 MHz, particularly when the scroll-value is zero. | ||
when dealing with decimal fractions, such as the ".1" in | * One workaround is to stick to integers, e.g. integer kHz | ||
122.1 MHz, particularly when the scroll-value is zero. | rather than fractional MHz. | ||
* One workaround is to stick to integers, e.g. integer | * Another workaround is to employ a small positive scroll value, step*1e-6 should suffice. | ||
* A final option (with CVS) is to use the bias tag to let the code know how to | |||
* Another workaround is to | handle round-off. Use a bias value of 1/2 your smallest step value, and | ||
scroll value. | use the same bias value on all digits. | ||
the | |||
What we really need is a whole new support routine for dealing | What we really need is a whole new support routine for dealing |
edits