[sage-devel] Re: Problem with Integer()

2008-11-29 Thread koffie
Srry, I think I got a bit lost from the core of the problem with some people talking about Integer(float(1.5)) an Integer(RR('1.0')). Making things like Integer("1.0") work for is ok to me. My previous reaction was probably a bit to worried reaction. I was woried about implicit functions call's w

[sage-devel] Re: Problem with Integer()

2008-11-28 Thread Robert Bradshaw
On Nov 28, 2008, at 7:45 AM, Ronan Paixão wrote: > Em Sex, 2008-11-28 às 05:03 -0800, koffie escreveu: >> I have to agree with William that something like Integer(float(1)) >> really should not work, this is because floats are really ugly and >> unpredictable things which are prone to a lot of er

[sage-devel] Re: Problem with Integer()

2008-11-28 Thread Ronan Paixão
Em Sex, 2008-11-28 às 05:03 -0800, koffie escreveu: > I have to agree with William that something like Integer(float(1)) > really should not work, this is because floats are really ugly and > unpredictable things which are prone to a lot of errors, and even > implementing Integer(float(X)) to work

[sage-devel] Re: Problem with Integer()

2008-11-28 Thread koffie
I have to agree with William that something like Integer(float(1)) really should not work, this is because floats are really ugly and unpredictable things which are prone to a lot of errors, and even implementing Integer(float(X)) to work only if X is just happens to be an integer wil not help to

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread Robert Bradshaw
On Nov 27, 2008, at 12:55 PM, Jason Grout wrote: > mabshoff wrote: >> >> >> On Nov 27, 12:34 pm, "William Stein" <[EMAIL PROTECTED]> wrote: >>> On Thu, Nov 27, 2008 at 12:30 PM, mabshoff >>> <[EMAIL PROTECTED]> wrote: >>> On Nov 27, 11:24 am, Jason Grout <[EMAIL PROTECTED]> wrote: >

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread William Stein
On Thu, Nov 27, 2008 at 3:16 PM, John H Palmieri <[EMAIL PROTECTED]> wrote: > > On Nov 27, 12:34 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > > [snip] > >> Moreover, Sage integers don't allow coercion from float: > > There is probably a good reason for this, but what is it? After all, > int(fl

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread John H Palmieri
On Nov 27, 12:34 pm, "William Stein" <[EMAIL PROTECTED]> wrote: [snip] > Moreover, Sage integers don't allow coercion from float: There is probably a good reason for this, but what is it? After all, int(float(1)) works, so why doesn't Integer(float(1))? (Also int(RR (1)) and Integer(RR(1)) bot

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread Ronan Paixão
Well, at least for my use I "fixed" it with rstrip('.'), and it would possibly also work to convert to CDF and then to Integer, though that would possibly create other hard-to-find problems. Well, it's worth raising the issue, even if the answer is negative. I for one never noticed int() didn't t

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread Jason Grout
mabshoff wrote: > > > On Nov 27, 12:34 pm, "William Stein" <[EMAIL PROTECTED]> wrote: >> On Thu, Nov 27, 2008 at 12:30 PM, mabshoff <[EMAIL PROTECTED]> wrote: >> >>> On Nov 27, 11:24 am, Jason Grout <[EMAIL PROTECTED]> wrote: Ronan Paixão wrote: > I just found a problem with Integer().

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread mabshoff
On Nov 27, 12:34 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 27, 2008 at 12:30 PM, mabshoff <[EMAIL PROTECTED]> wrote: > > > On Nov 27, 11:24 am, Jason Grout <[EMAIL PROTECTED]> wrote: > >> Ronan Paixão wrote: > >> > I just found a problem with Integer(). It doesn't seem to work

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread William Stein
On Thu, Nov 27, 2008 at 12:30 PM, mabshoff <[EMAIL PROTECTED]> wrote: > > > > On Nov 27, 11:24 am, Jason Grout <[EMAIL PROTECTED]> wrote: >> Ronan Paixão wrote: >> > I just found a problem with Integer(). It doesn't seem to work fine with >> > float strings. >> > Those work fine: >> > Integer("1")

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread mabshoff
On Nov 27, 11:24 am, Jason Grout <[EMAIL PROTECTED]> wrote: > Ronan Paixão wrote: > > I just found a problem with Integer(). It doesn't seem to work fine with > > float strings. > > Those work fine: > > Integer("1") > > Integer(1.) > > > But this doesn't: > > Integer("1.") > > More data: > > Int

[sage-devel] Re: Problem with Integer()

2008-11-27 Thread Jason Grout
Ronan Paixão wrote: > I just found a problem with Integer(). It doesn't seem to work fine with > float strings. > Those work fine: > Integer("1") > Integer(1.) > > But this doesn't: > Integer("1.") More data: Integer(RR('1.')) works Integer(RR('1.0')) works Integer('1.0') doesn't work I thin