Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Charles R Harris
On 9/4/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 9/4/06, Sebastian Haase < [EMAIL PROTECTED]> wrote: Paulo J. S. Silva wrote:> Once again, the information that singed zero is part of IEEE standard is> in the paper I cited in my last message.>> It is very important to be able to compute the

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread David M. Cooke
On Mon, 4 Sep 2006 01:53:40 -0400 "A. M. Archibald" <[EMAIL PROTECTED]> wrote: > > A better question to ask is, "Can I change numpy's rounding behaviour > for my programs?" (And, more generally, "can I set all the various > floating-point options that the IEEE standard and my processor both > supp

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Paulo J. S. Silva
Ops, I believe you were caught by int versus float here: In [16]:around(66.0, decimals=-1) Out[16]:70.0 In [17]:around(66, decimals=-1) Out[17]:60 Note that in the int case, it seems like round is simply truncation. Paulo --

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Charles R Harris
On 9/4/06, Sebastian Haase <[EMAIL PROTECTED]> wrote: Paulo J. S. Silva wrote:> Once again, the information that singed zero is part of IEEE standard is> in the paper I cited in my last message.>> It is very important to be able to compute the sign of an overflowed > quantity in expressions like 1/

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Sebastian Haase
Paulo J. S. Silva wrote: > Once again, the information that singed zero is part of IEEE standard is > in the paper I cited in my last message. > > It is very important to be able to compute the sign of an overflowed > quantity in expressions like 1/x when x goes to zero. > > Best, > > Paulo Hi,

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Paulo J. S. Silva
Once again, the information that singed zero is part of IEEE standard is in the paper I cited in my last message. It is very important to be able to compute the sign of an overflowed quantity in expressions like 1/x when x goes to zero. Best, Paulo -

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Charles R Harris
On 9/4/06, Paulo J. S. Silva <[EMAIL PROTECTED]> wrote: Interesting, I was just reading about the round rule in IEEE standardlast Friday.What numpy's "around" function does is called "round to even" (round istake to make the next digit even), instead of "round up". According to "What every computer

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Paulo J. S. Silva
Interesting, I was just reading about the round rule in IEEE standard last Friday. What numpy's "around" function does is called "round to even" (round is take to make the next digit even), instead of "round up". According to "What every computer scientist should know about floating-point arithmet

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-03 Thread A. M. Archibald
On 04/09/06, Sebastian Haase <[EMAIL PROTECTED]> wrote: > Thanks for the reply - but read what the doc says: > >>> N.around.__doc__ > 'Round 'a' to the given number of decimal places. Rounding > behaviour is equivalent to Python. > > Return 'a' if the array is not floating point. Roun

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-03 Thread Sebastian Haase
Charles R Harris wrote: > > > On 9/3/06, *Sebastian Haase* <[EMAIL PROTECTED] > > wrote: > > Hi, > I just learn about the existence of round(). > Is the following exposing a bug? > >>> N.__version__ > '1.0b4' > >>> N.array([65.0]) > [ 65.]

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-03 Thread Charles R Harris
On 9/3/06, Sebastian Haase <[EMAIL PROTECTED]> wrote: Hi,I just learn about the existence of round().Is the following exposing a bug? >>> N.__version__'1.0b4' >>> N.array([65.0])[ 65.] >>> _.round(-1)[ 60.] >>> round(65, -1) 70.0 >>> N.array([65])[65] >>> _.round(-1)[60] >>> N.array([66])[66] >>> _