This seems basic, so please excuse me if it is a common question.

I have a table defined like this:

CREATE TABLE map ( 
                runID INT, type TEXT, itemID int, 
            att0 NUMERIC, att1 NUMERIC, PRIMARY KEY ( runID, type, itemID )
);

Here are the first four rows:

1|c|0|0.0290534291416|-0.580828785896
1|c|1|-0.0737001597881|1.31409645081
1|c|2|-0.957751333714|0.651466667652
1|c|3|-0.229464128613|0.659206032753

Adding values to att0  (one of the numeric columns) gives this odd result:

sqlite> select itemid, att0, (att0 + 0.95) dx from map;
0|0.0290534291416|
1|-0.0737001597881|
2|-0.957751333714|-0.00775133371400005
3|-0.229464128613|
4|-1.05415046215|-0.10415046215
...
7|1.09137058258|2.04137058258

I don't understand why some values of att0 cannot be added to 0.95 and don't
see a pattern (which is why I included row 7. Could someone explain please?

I am using sqlite3 3.5.9 on ubuntu to query the database. I am using python
2.5 to create and enter the numbers.


Tom




-- 
View this message in context: 
http://www.nabble.com/Elementary-arithmetic-question-tp20737193p20737193.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to