On Monday, February 3, 2014 11:05:50 PM UTC+5:30, mario wrote:
>
> 5.2 is a Python floating point number (a double) represented as 
> 5854679515581645*2**(-50);
> using Rational( '5.2' ) it is recognized as exactly 52/10
>
>
Isn't it better to have Rational(5.2) also store 26/5 , just like Rational( 
'5.2' ) does ?
Is there a reason why it is left the way it is?

I can make a patch for this, if more people feel this way.


 

> On Monday, February 3, 2014 4:37:56 PM UTC+1, Rajath Shashidhara wrote:
>>
>>
>> Hello,
>>
>> I was checking out some SymPy code.
>> I have a doubt -
>>
>> Rational( 5.2 ) returns 5854679515581645/1125899906842624
>> whereas,
>> Rational( '5.2' ) returns 26/5 
>>
>> why is it so?
>>
>> Is is designed to work that way?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to