[Deb-scipy-devel] Bug#441439: Roundoff error results in arange vectors of wrong dimensions

Gudjon I. Gudjonsson gudjon at gudjon.org
Sun Sep 9 20:05:54 UTC 2007


Subject: python-numpy: Roundoff error makes arange vectors of wrond dimensions
Package: python-numpy
Version: 1:1.0.3-1
Severity: normal

*** Please type your report below this line ***
When I do the following in python:
>>> from numpy import *
>>> a=0.6
>>> a
0.59999999999999998
>>> arange(0,a,0.2)
array([ 0. ,  0.2,  0.4])
>>> a=0.4+0.2
>>> a
0.60000000000000009
>>> arange(0,a,0.2)
array([ 0. ,  0.2,  0.4,  0.6])

The array should include the following numbers
0, 0.2, 0.4 no matter if I define the end number as
0.2+0.4 or 0.6.

Regards
Gudjon

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-5-k7 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-numpy depends on:
ii  atlas3-3dnow [liblapac 3.6.0-20.6        Automatically Tuned Linear 
Algebra
ii  atlas3-base [liblapack 3.6.0-20.6        Automatically Tuned Linear 
Algebra
ii  atlas3-sse [liblapack. 3.6.0-20.6        Automatically Tuned Linear 
Algebra
ii  atlas3-sse2 [liblapack 3.6.0-20.6        Automatically Tuned Linear 
Algebra
ii  lapack3 [liblapack.so. 3.0.20000531a-6.1 library of linear algebra 
routines
ii  libc6                  2.6.1-2           GNU C Library: Shared libraries
ii  libg2c0                1:3.4.6-6         Runtime library for GNU Fortran 
77
ii  libgcc1                1:4.2.1-5         GCC support library
ii  python                 2.4.4-6           An interactive high-level 
object-o
ii  python-central         0.5.15            register and build utility for 
Pyt
ii  python-numpy-dev       1:1.0.3-1         Numerical Python adds a fast 
array
ii  refblas3 [libblas.so.3 1.2-8             Basic Linear Algebra Subroutines 
3

python-numpy recommends no packages.

-- no debconf information





More information about the Deb-scipy-devel mailing list