Re: [sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread Dan Drake
On Wed, 31 Oct 2012 at 08:47AM -0700, mmarco wrote: > My view: since this was revealed to my as a problem by a professor in > my university, who had problems runnning in class something like this: > > for i in range(10): > print cos(i).n() > > i think that the result should be, at least, some

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread Nils Bruin
On Oct 31, 8:47 am, mmarco wrote: > for i in range(10): >     print cos(i).n() ... > Besides, 0 should be converted to Integer(0) by the > preparser, right? so the criterion of keeping the input type also > points to the same direction. *keeping* input types would still let your example fail, sin

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread John H Palmieri
On Wednesday, October 31, 2012 10:01:01 AM UTC-7, kcrisman wrote: > > > > On Wednesday, October 31, 2012 11:47:20 AM UTC-4, mmarco wrote: >> >> My view: since this was revealed to my as a problem by a professor in >> my university, who had problems runnning in class something like this: >> >> f

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread kcrisman
On Wednesday, October 31, 2012 11:47:20 AM UTC-4, mmarco wrote: > > My view: since this was revealed to my as a problem by a professor in > my university, who had problems runnning in class something like this: > > for i in range(10): > print cos(i).n() > > i think that the result should

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread mmarco
My view: since this was revealed to my as a problem by a professor in my university, who had problems runnning in class something like this: for i in range(10): print cos(i).n() i think that the result should be, at least, something that has the .n() procedure implemented. That is: Integer se

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-31 Thread Simon King
On 2012-10-31, Julien Puydt wrote: > Le 30/10/2012 22:58, David Roe a écrit : >> I think this is a bug: the type of the result should be consistent. > > I think that if you expect a type foo but get a type bar which can be > auto-coerced to type foo, then it's fine, even if not constant. +1 Aft

[sage-devel] Re: Bug in functions sin, cos, exp...

2012-10-30 Thread Nils Bruin
On Oct 30, 2:58 pm, David Roe wrote: > I think this is a bug: the type of the result should be consistent. > David Consistent doesn't mean constant. Functions like "sin" are generic functions that dispatch on input type: sin(1.2) should return a float, not a symbolic expression (that would be un