<div dir="ltr">Yes, we should probably change this to use&nbsp;System.Double.ToString(&#39;G17&#39;)<div><br><div class="gmail_quote">On Thu, Sep 4, 2008 at 7:41 AM, Christian Muirhead <span dir="ltr">&lt;<a href="mailto:christian.muirhead@resolversystems.com">christian.muirhead@resolversystems.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">Michael Foord wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Pickle on IronPython doesn&#39;t preserve sufficient information to unpickle floats accurately:<br>
<br>
CPython:<br>
&nbsp;&gt;&gt;&gt; a = 1 /3.0<br>
&nbsp;&gt;&gt;&gt; import cPickle as pickle<br>
&nbsp;&gt;&gt;&gt; pickle.loads(pickle.dumps(a)) == a<br>
</blockquote></div>
(Michael meant to say that this was True)<div class="Ih2E3d"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
IronPython:<br>
&nbsp;&gt;&gt;&gt; import cPickle as pickle<br>
&nbsp;&gt;&gt;&gt; a = 1 /3.0<br>
&nbsp;&gt;&gt;&gt; pickle.loads(pickle.dumps(a)) == a<br>
False<br>
<br>
This is actually causing us numerical errors in Resolver One. CPython is actually very careful about its string representation of floats so that this is possible.<br>
</blockquote>
<br></div>
I think it&#39;s because IP cPickle is relying on the .NET Double.ToString which isn&#39;t as truthful as cPython&#39;s repr.<br>
<br>
The issue&#39;s covered here: <a href="http://www.python.org/doc/current/tut/node16.html" target="_blank">http://www.python.org/doc/current/tut/node16.html</a><br>
<br>
xtian<br>
<br>
<br>
-- <br>
Christian Muirhead<br>
Resolver Systems<br>
<a href="mailto:christian.muirhead@resolversystems.com" target="_blank">christian.muirhead@resolversystems.com</a><br>
We&#39;re hiring! <a href="http://www.resolversystems.com/jobs/" target="_blank">http://www.resolversystems.com/jobs/</a><br>
<br>
<br>
Resolver Systems Ltd<br>
17a Clerkenwell Road, London EC1M 5RD, UK<br>
VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329.<br>
Registered address: 843 Finchley Road, London NW11 8NA, UK<div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div><br></div></div>