https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112009-09-08T07:53:40ZRuby Issue Tracking SystemRuby 1.8 - Bug #1566: sprintf with %e or %E Format Specifer Incorrectly Capitalises Inf and NaNhttps://bugs.ruby-lang.org/issues/1566?journal_id=56862009-09-08T07:53:40Zm (m .)m@mheroin.com
<ul><li><strong>File</strong> <a href="/attachments/515">fix-nan-and-inf-in-sprintf.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/515/fix-nan-and-inf-in-sprintf.diff">fix-nan-and-inf-in-sprintf.diff</a> added</li></ul><p>=begin<br>
The attached patch fixes this by removing the Windows-only ifdef that currently guards the portion of the code doing the formatting of the resulting string.</p>
<p>I'm not sure of why it was guarded in the first place (the code works fine in OS X) so please test this on Linux/other platforms and apply if you consider this change is worth making.<br>
=end</p> Ruby 1.8 - Bug #1566: sprintf with %e or %E Format Specifer Incorrectly Capitalises Inf and NaNhttps://bugs.ruby-lang.org/issues/1566?journal_id=56872009-09-08T09:15:24Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>knu (Akinori MUSHA)</i></li><li><strong>Target version</strong> changed from <i>Ruby 1.8.6</i> to <i>Ruby 1.8.8</i></li></ul><p>=begin</p>
<p>=end</p> Ruby 1.8 - Bug #1566: sprintf with %e or %E Format Specifer Incorrectly Capitalises Inf and NaNhttps://bugs.ruby-lang.org/issues/1566?journal_id=380392013-03-30T05:17:34Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/38039/diff?detail_id=27434">diff</a>)</li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li></ul><p>1.8's sprintf is a simple wrapper of sprintf(3).<br>
sprintf(3)'s e/E behaves as you said.<br>
See also <a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html" class="external">http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html</a></p>