<div class="gmail_quote">On Thu, Dec 2, 2010 at 11:17 AM, Ken Basye <span dir="ltr"><<a href="mailto:kbasye1@jhu.edu">kbasye1@jhu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Thanks for the replies.<br>
<br>
Robert is right; many numerical operations, particularly complex ones,<br>
generate different values across platforms, and we deal with these by<br>
storing the values from some platform as a reference and using<br>
allclose(), which requires extra work.  But many basic operations<br>
generate the same underlying values on IEEE 754-compliant platforms but<br>
don't always format floats consistently (see<br>
<a href="http://bugs.python.org/issue1580" target="_blank">http://bugs.python.org/issue1580</a> for a lengthy discussion on this).  My<br>
impression is that Python 2.7 does a better job here, but at this point<br>
a lot of differences also crop up between 2.6 (or less) and 2.7 due to<br>
the changed formatting built into 2.7, and these are the result of<br>
formatting differences; the numbers themselves are identical (in our<br>
experience so far, at any rate).  This is a current pain-point which an<br>
exact representation would alleviate.<br>
<br>
In response to David, we haven't implemented a separate print; we rely<br>
on the Numpy repr/str for ndarrays and the printoptions that allow some<br>
control over float formatting.  I'm basically proposing to add a bit<br>
more control there.  And thanks for the info on supported versions of<br>
Python.<br>
<font color="#888888"><br>
      Ken<br>
</font><div><br></div></blockquote><div><br>Another approach to consider is to save the numerical data in a platform-independent standard file format (maybe like netcdf?).  While this isn't a fool-proof approach because the calculations themselves may introduce differences that are platform dependent, this at least puts strong controls on one aspect of the overall problem.<br>

<br>One caveat that does come across my mind is if the save/load process for the file might have some platform-dependent differences based on the compression/decompression schemes.  For example, the GRIB file format does a compression where the mean value and the differences from those means are stored.  Calculations like these might introduce some slight differences on various platforms.<br>

<br>Just food for thought,<br>Ben Root<br><br></div></div>