On 5/2/2010 1:51 PM, Gökhan Sever wrote:
> The following is another surprise output:
>
> I[5]: c = np.arange(0.4, 0.5, 0.1, dtype='float32')
> [6]: c
> O[6]: array([ 0.4001], dtype=float32)
>>> a = np.array([0.4,0.5,0.1], dtype='float32')
>>> a[0]
0.4001
>>> (a[1]-a[0])/a[2]
0.9994
>
On Sat, May 1, 2010 at 3:36 PM, Gökhan Sever wrote:
> Hello,
>
> Is "b" an expected value? I am suspecting another floating point arithmetic
> issue.
>
> I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32')
>
> I[2]: a
> O[2]: array([ 1.6002, 1.7005], dtype=float32)
>
> I[3]: b = np.arang
On Sat, May 1, 2010 at 15:36, Gökhan Sever wrote:
> Hello,
>
> Is "b" an expected value? I am suspecting another floating point arithmetic
> issue.
>
> I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32')
>
> I[2]: a
> O[2]: array([ 1.6002, 1.7005], dtype=float32)
>
> I[3]: b = np.arange(1
Gökhan Sever wrote:
> Hello,
>
> Is "b" an expected value? I am suspecting another floating point
> arithmetic issue.
Exactly. You'll see the same type of problem with float64, too:
In [17]: z = np.arange(1.7, 1.8, 0.1)
In [18]: z
Out[18]: array([ 1.7, 1.8])
In [19]: z[1] == 1.8
Out[19]: Tr
On Sat, May 1, 2010 at 1:36 PM, Gökhan Sever wrote:
> Hello,
>
> Is "b" an expected value? I am suspecting another floating point arithmetic
> issue.
>
> I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32')
>
> I[2]: a
> O[2]: array([ 1.6002, 1.7005], dtype=float32)
>
> I[3]: b = np.arange
On 1 May 2010 16:36, Gökhan Sever wrote:
> Hello,
>
> Is "b" an expected value? I am suspecting another floating point arithmetic
> issue.
>
> I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32')
>
> I[2]: a
> O[2]: array([ 1.6002, 1.7005], dtype=float32)
>
> I[3]: b = np.arange(1.7, 1.8,
Hello,
Is "b" an expected value? I am suspecting another floating point arithmetic
issue.
I[1]: a = np.arange(1.6, 1.8, 0.1, dtype='float32')
I[2]: a
O[2]: array([ 1.6002, 1.7005], dtype=float32)
I[3]: b = np.arange(1.7, 1.8, 0.1, dtype='float32')
I[4]: b
O[4]: array([ 1.7005, 1.