logo       

RE: A bug in creating array of long int.: msg#00057

python.numeric.general

Subject: RE: A bug in creating array of long int.

Daehyok Shin (Peter) wrote:

> I got the following strange value when converting a long integer into
> numarray. I spent some time in tracking it down in my program.
> Is it a bug or an expected one? Thanks.
>
> >>> array([True])
> array([1], type=Bool)
> >>> array([1])
> array([1])
> >>> array([1L]) # How about preserving long int type?
> array([1])
> >>> array([10000000000000000L])
> array([1874919424]) # Oops. The value is changed without any notice.
>
So, what were you hoping would happen? An exception? Automatically setting
type to Int64? (and if that case, what about values too large for Int64s?)
(I'm assuming you are aware that Python longs are not 64 bit ints).

This probably could be handled better. We'll look into it.

Perry



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise