Python float copy question

Posted by SJA on Stack Overflow See other posts from Stack Overflow or by SJA
Published on 2010-03-26T16:40:02Z Indexed on 2010/03/26 16:43 UTC
Read the original article Hit count: 305

Filed under:
|
|

Hi,

I'm puzzled by some behaviour I'm seeing when copying a float array member into another variable - please help!

For example

data_entry[1] = 9.6850069951

new_value = data_entry[1]


<comment> #print both

9.6850069951


9.6850663300

I'm aware of the problem of binary storage of floats but I thought with a direct copy of memory we would end up with the same value.

Any ideas? I need better precision than this! thanks in advance Stuart

© Stack Overflow or respective owner

Related posts about python

Related posts about float