[sympy] RFC: should Rational accept floats?

2012-11-30 Thread smichr
At http://code.google.com/p/sympy/issues/detail?can=2&q=2950 I give the reasons why I don't think it should. The work is at https://github.com/sympy/sympy/pull/1680 (which disallows it). Should we just let the user shoot themselves in the foot if they request Rational from floats or should we

Re: [sympy] RFC: should Rational accept floats?

2012-11-30 Thread Aaron Meurer
It's worth pointing out that Float does the same thing, if you give it a high enough precision. Try Float(3.2, 100) for example. To me, it should just work. Yes, we should encourage the use of strings over float literals, but Rational(float) not working makes it seem as if the conversion is not su

Re: [sympy] RFC: should Rational accept floats?

2012-11-30 Thread Ronan Lamy
Le 30/11/2012 22:23, Aaron Meurer a écrit : It's worth pointing out that Float does the same thing, if you give it a high enough precision. Try Float(3.2, 100) for example. To me, it should just work. Yes, we should encourage the use of strings over float literals, but Rational(float) not workin

Re: [sympy] RFC: should Rational accept floats?

2012-12-01 Thread Christophe BAL
Hello, from mathematical point of view, the floats are a kind of approximations. So if someone wants to have a rational form of one float, I think that it could be better that this user must convert first the float to one decimal and then to one rational. Not user friendly but more precise. I don'

Re: [sympy] RFC: should Rational accept floats?

2012-12-01 Thread Chris Smith
On Sat, Dec 1, 2012 at 5:33 PM, Christophe BAL wrote: > Hello, > from mathematical point of view, the floats are a kind of approximations. > So if someone > wants to have a rational form of one float, I think that it could be > better that this user must > convert first the float to one decimal a

Re: [sympy] RFC: should Rational accept floats?

2012-12-01 Thread Chris Smith
On Sat, Dec 1, 2012 at 12:17 PM, Ronan Lamy wrote: > Le 30/11/2012 22:23, Aaron Meurer a écrit : > >> It's worth pointing out that Float does the same thing, if you give it a >> high enough precision. Try Float(3.2, 100) for example. >> >> To me, it should just work. Yes, we should encourage the