[SciPy-user] possible to get INF in divide by zero ?

Vincent Favre-Nicolin vincefn at users.sourceforge.net
Thu Aug 28 02:49:57 EDT 2008


On jeudi 28 août 2008, Stef Mientki wrote:
> I wonder if it's possible to get the MatLab behavior :
> divide by zero gives infinite (INF) ?
>
> I even wonder if something like INF exists in python / scipy / numpy.

  Isn't this already the behaviour of numpy ?

In [6]: ones(10)/0
Warning: divide by zero encountered in divide
Out[6]: array([ Inf,  Inf,  Inf,  Inf,  Inf,  Inf,  Inf,  Inf,  Inf,  Inf])

	Vincent
-- 
Vincent Favre-Nicolin

CEA Grenoble/INAC/SP2M			http://inac.cea.fr
Univ. Joseph Fourier (Grenoble) http://www.ujf-grenoble.fr

ObjCryst & Fox			http://objcryst.sf.net/Fox



More information about the SciPy-User mailing list