It is disconcerting that $x2 prints as "258160", but becomes something else when used in a subtraction
I totally agree with you.
The internal hex representation of the double 258160.0 is 410f838000000000, but the internal hex representation of $x2 is 410f838000000001 which should really be printed as 2.5816000000000003e5.
Unfortunately, perl limits the printed output of floats to 15 decimal digits - and, as you can see, if you round $x2 to 15 decimal digits of precision you get 258160.0.
There has been some talk about fixing this
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>
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
Want more info? How to link or
or How to display code and escape characters
are good places to start.