Bug #1402
closedmultiple by 8 / 10 instead of 0.8 to prevent the need for floating support
Description
in server.c, please replace "0.8" by "8 / 10".
This allows using lighttpd to run without floating point emulation on embedded machines without floating point support (such as ARM).
This fix has been tested in OpenEmbedded for long now. Please consider merging it.
-- leonw
Files
Updated by stbuehler about 16 years ago
- Target version changed from 1.4.20 to 1.4.21
Updated by LX about 16 years ago
Anonymous wrote:
in server.c, please replace "0.8" by "8 / 10".
This allows using lighttpd to run without floating point emulation on embedded machines without floating point support (such as ARM).
This fix has been tested in OpenEmbedded for long now. Please consider merging it.
-- leonw
Instead of "* 8 / 10", it would be faster to use "<< 3 / 10" and still work on embedded systems.
Greetings, LX
Updated by stbuehler about 16 years ago
- Patch available set to No
LX wrote:
Instead of "* 8 / 10", it would be faster to use "<< 3 / 10" and still work on embedded systems.
Greetings, LX
If it is faster with your compiler, you should not use that compiler. Never "optimize" such things, they only make your code less readable.
Updated by peto about 16 years ago
There's nothing wrong with the patch that I can see. stbuehler is correct that rewriting math with shifts is usually a bad idea, but the patch didn't do that. Rewriting floating point math as integer math is often a very good idea. Not only does it work better on embedded systems with no FPU, it's also more easily predictable (though off-by-one rounding errors in this particular case would be harmless).
Updated by stbuehler almost 16 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset r2381.
Also available in: Atom