Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<del> It looks like it was a Perl build configuration issue. The Perl build supports a `d_longdbl` option, which indicates whether long doubles are allowed or not. You can test whether it is set on your machine with:</del> <pre><code>perl -V:d_longdbl </code></pre> <p>More info at <a href="http://perldoc.perl.org/functions/sprintf.html" rel="nofollow noreferrer">perldoc sprintf</a>. Thanks for your input everybody.</p> <hr> <p>Edit:</p> <p>Nope, that wasn't it either. Close inspection of the sprintf documentation revealed that the modifiers for a long double are <code>q</code>, <code>ll</code>, and <code>L</code>, <strong>NOT</strong> <code>l</code>. <code>l</code> is a valid modifer for integer types. D'oh.</p> <p>It looks like most installations of perl will silently ignore the <code>l</code>, and parse the rest of the modifier correctly. Except on our user's site. ☹ Anyway, the problem was fixed by using a valid modifier for a long double.</p> <p>FYI, I played with the same format specifiers in the C <code>printf</code>.</p> <pre><code>printf("The number is %lG\n", 0.001); printf("The number is %LG\n", 0.001); </code></pre> <p>The first call “worked”, printing out <code>0.001</code>, but the second call printed out a garbage value until I properly specified the type of the numeric literal:</p> <pre><code>printf("The number is %LG\n", 0.001L); </code></pre> <p>Apparently the C <code>printf</code> is silently ignoring the improper <code>l</code> modifier. This makes me suspect that most Perl installations ignore it too.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload