On 5/4/19, Manuel Rigger <[email protected]> wrote: > Hi everyone, > > Consider the following example: > > CREATE TABLE t1 (c0, c1 REAL, PRIMARY KEY (c1, c0)); > INSERT INTO t1(c1) VALUES (0X7ffffffffffffff);; > SELECT ALL * FROM t1 WHERE c1 = 5.76460752303423e+17; > > I would expect the row to be fetched, which is not the case.
But 0x7ffffffffffffff != 5.76460752303423e+17. Try it: SELECT 0x7ffffffffffffff != 5.76460752303423e+17; You should get back 0. The rule of thumb is to never expect the == operator to give a meaningful answer for floating-point numbers. Only use <, <=, >, and >=. -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

