Wow, this is mighty strange... I added some more prints of calculations, as so:
printf "%3.5g %3.5g %3.5g %3.5g\n",
($e+0), (0+$e), (0-$e),($e-0);
printf "%3.5g %3.5g %3.5g %3.5g\n",
($e+1), (1+$e), (1-$e),($e-1);
printf "%3.5g %3.5g %3.5g %3.5g\n",
($e+$e), ($e-$e), ($e*$e),($e/$e);
printf "%3.5g %3.5g %3.5g %3.5g\n",
($e**2), ($e**0), (0/$e),($e/0);
The output was:
0 0 0 0
1 1 1 -1
2 0 1 1
0 1 0 0
In particular, note that the final calculation is ($e/0). The anomaly is more than just $e having an ambiguous value, it seems.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.