[Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich , comparison
Steven D. Majewski
sdm7g at virginia.edu
Thu Oct 26 15:49:10 EDT 2000
On 26 Oct 2000, Pete Forman wrote:
> Most of this thread is concerned with whether doing an operation with
> two integers should produce a result which is not an integer.
>
> What has not been mentioned is that the "2" and "3" are integers. If
> you want them to be floats they should be spelt "2." and "3." in the
> same way that longs would be spelt "2L" and "3L". It may be possible
> to change the language so that unadorned numbers are floats and some
> suffix is introduced for integers. I don't think that you'd get many
> takers for that.
I'm not particularly happy that 2000000 * 2000000 gives me an
overflow error and I have to remember to append an "L" to one or
more of those operands. Would you suggest that for consistency,
3/2 signal an error, since the answer is outside the domain ?
That's not the solution I prefer, but at least it's consistent
and it gives a warning rather than the wrong answer.
---| Steven D. Majewski (804-982-0831) <sdm7g at Virginia.EDU> |---
---| Department of Molecular Physiology and Biological Physics |---
---| University of Virginia Health Sciences Center |---
---| P.O. Box 10011 Charlottesville, VA 22906-0011 |---
"All operating systems want to be unix,
All programming languages want to be lisp."
More information about the Python-list
mailing list