<!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.2658.2">
<TITLE>RE: A Revised Rational Proposal</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>[Mike Meyer]</FONT>
</P>

<P><FONT SIZE=2>#- When combined with a floating type - either complex or float - or a</FONT>
<BR><FONT SIZE=2>#- decimal type, the result will be a TypeError.  The reason for this is</FONT>
<BR><FONT SIZE=2>#- that floating point numbers - including complex - and decimals are</FONT>
<BR><FONT SIZE=2>#- already imprecise.  To convert them to rational would give an</FONT>
</P>

<P><FONT SIZE=2>I'm ok with raising TypeError when mixing with float.</FONT>
</P>

<P><FONT SIZE=2>Bu tI think that it should interact with decimal, as decimal is not imprecise: you can go Decimal->Rational and viceversa without losing information.</FONT></P>

<P><FONT SIZE=2>As I posted in a previous message:</FONT>
</P>

<P><FONT SIZE=2>To convert a Decimal to Rational, just take the number and divide it by 1E+n:</FONT>
</P>

<P><FONT SIZE=2>  Decimal(5) -> Rational(5)</FONT>
<BR><FONT SIZE=2>  Decimal("5.35") -> Rational(535, 100)</FONT>
</P>

<P><FONT SIZE=2>To convert a Rational to a Decimal, it would be a good idea to have a method that converts the Rational to a Decimal string...</FONT></P>

<P><FONT SIZE=2>  Rational(5).tostring(6) -> "5.00000"</FONT>
<BR><FONT SIZE=2>  Rational(4, 5).tostring(3) -> "0.80"</FONT>
<BR><FONT SIZE=2>  Rational(5321351343, 2247313131).tostring(5000) -> whatever</FONT>
</P>

<P><FONT SIZE=2>... and then take that string as input to Decimal and it will work.</FONT>
</P>
<BR>

<P><FONT SIZE=2>#- - Should raising a rational to a non-integer rational </FONT>
<BR><FONT SIZE=2>#- silently produce</FONT>
<BR><FONT SIZE=2>#-   a float, or raise an InvalidOperation exception?</FONT>
</P>

<P><FONT SIZE=2>I think that it never should decay into float silently.</FONT>
</P>
<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>