[Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich , comparison

Steven D. Majewski sdm7g at virginia.edu
Tue Oct 24 16:13:51 EDT 2000


On Tue, 24 Oct 2000, Fredrik Lundh wrote:

> Alice uses python to control 3D objects, and they
> found that users had real problems accepting that
> 
>     myBunny.moveForward(2/3)
> 
> left the bunny standing there, instead of moving it
> 2/3 units forward.
> 
> but for programmers, the real problem is that "/" in an
> expression like "a/2" is sometimes an integer division,
> and sometimes a floating point division, depending on
> what data you happen to pass your function...
> 
> I've been programming Python full time for over five
> years, and this is still causing me headaches from time
> to time (I never had this problem when I was using C
> and C++.  go figure ;-)

I figure it's cause C and C++ have explicitly declared static 
typing and even if you don't look back at the declarations, 
you're aware of them when programming. 

For a dynamically typed language like Python, it's a bit odd
to insist on closure: (int) OP (int) => (int).  

If rational was a builtin, I'ld argue for rational.
Otherwise, it should be real. 


---|  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