https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412008-10-08T19:02:07Zlighty labsLighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=43692008-10-08T19:02:07Zstbuehler
<ul><li><strong>Target version</strong> changed from <i>1.4.20</i> to <i>1.4.21</i></li></ul> Lighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=50232008-10-26T09:06:40ZLX
<ul></ul><p>Anonymous wrote:</p>
<blockquote>
<p>in server.c, please replace "0.8" by "8 / 10".</p>
<p>This allows using lighttpd to run without floating point emulation on embedded machines without floating point support (such as ARM).</p>
<p>This fix has been tested in OpenEmbedded for long now. Please consider merging it.</p>
<p>-- leonw</p>
</blockquote>
<p>Instead of "* 8 / 10", it would be faster to use "<< 3 / 10" and still work on embedded systems.</p>
<p>Greetings, LX</p> Lighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=50242008-10-26T09:34:45Zstbuehler
<ul><li><strong>Patch available</strong> set to <i>No</i></li></ul><p>LX wrote:</p>
<blockquote>
<p>Instead of "* 8 / 10", it would be faster to use "<< 3 / 10" and still work on embedded systems.</p>
<p>Greetings, LX</p>
</blockquote>
<p>If it is faster with your compiler, you should not use that compiler. Never "optimize" such things, they only make your code less readable.</p> Lighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=50502008-10-27T18:20:55Zralf
<ul></ul><p>Whats wrong with the patch from leonw?</p> Lighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=50592008-10-31T21:48:10Zpeto
<ul></ul><p>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).</p> Lighttpd - Bug #1402: multiple by 8 / 10 instead of 0.8 to prevent the need for floating supporthttps://redmine.lighttpd.net/issues/1402?journal_id=52892009-02-03T21:05:06Zstbuehler
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r2381.</p>