<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [Python-Dev] Expert floats</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Andrew Koenig wrote:</FONT>
</P>
<P><FONT SIZE=2>#- Well, some of it. It still doesn't avoid 1E50 + 1E-50 == </FONT>
<BR><FONT SIZE=2>#- 1E50, for example.</FONT>
</P>
<P><FONT SIZE=2>Nice example:</FONT>
</P>
<P><FONT SIZE=2>>>> import Decimal</FONT>
<BR><FONT SIZE=2>>>> d1 = Decimal.Decimal('1E50')</FONT>
<BR><FONT SIZE=2>>>> d2 = Decimal.Decimal('1E-50')</FONT>
<BR><FONT SIZE=2>>>> d1 + d2</FONT>
<BR><FONT SIZE=2>Decimal( (0, (1, 0, 0, 0, 0, 0, 0, 0, 0), 42L) )</FONT>
<BR><FONT SIZE=2>>>> d1 + d2 == d1</FONT>
<BR><FONT SIZE=2>True</FONT>
<BR><FONT SIZE=2>>>> Decimal.getcontext().prec = 1000</FONT>
<BR><FONT SIZE=2>>>> d1 + d2 == d1</FONT>
<BR><FONT SIZE=2>False</FONT>
<BR><FONT SIZE=2>>>> d1 + d2</FONT>
<BR><FONT SIZE=2>Decimal( (0, (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), -50L) )</FONT></P>
<P><FONT SIZE=2>Regards,</FONT>
</P>
<P><FONT SIZE=2>. Facundo</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><B><FONT SIZE=2>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</FONT></B></P>
<P><B><U><FONT SIZE=2>ADVERTENCIA </FONT></U> </B>
</P>
<P><B><FONT SIZE=2>La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley. </FONT></B></P>
<P><B><FONT SIZE=2>Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. </FONT></B></P>
<P><B><FONT SIZE=2>Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada. </FONT></B></P>
<P><B><FONT SIZE=2>Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje. </FONT></B></P>
<P><B><FONT SIZE=2>Muchas Gracias.</FONT></B>
</P>
</BODY>
</HTML>