From: Konrad H. <hi...@cn...> - 2002-08-12 13:00:39
|
bryan cole <bry...@te...> writes: > I'm trying to generate a gaussian distribution by: > > Input = Numeric.arange(-1024,1024)/20.0 > Output = Numeric.exp(-(Input**2)) > > At the edges of the distribution the largish negative arguments cause > the f.p. exception and prevent calculation of the entire array. > > On windows the underflow errors are presumably rounded down to 0.0 > automatically. Is it possible to get this behaviour on linux/ix86? Yes, rebuild the Python interpreter (not NumPy!) and add the compilation option "-lieee". Alternatively, download and install the current development version of Python from the CVS server (I haven't tried it, but it is supposed to fix this problem as well). Ultimately the problem is in the C standard library. On some platforms it signals underflow as an overflow error, on others it doesn't. Python thus has to get work around such problems in a platform-specific way. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |