The brute force and ignorance method of test for floating point equality is to test for a difference less than a specified limit. The difference is just a little bit larger than the expected aproximation error.
My sugestion with dates is to spend a little time extending the embedded sqlite date functions so that you have a library of functions to compare and perform date arithmetic. The Sqlite date functions are clearly written and very easy to use as a template for futher functions. Gerry Snyder wrote: > Alexey Pechnikov wrote: > >>1. I try to select: >> >>sqlite> select save_date from photo_tags where save_date<2454612.21079943 >>limit 1 offset 3073; >>save_date = 2454612.21079943 >> >>But 2454612.21079943<2454612.21079943 is wrong result. >> >>2.... >> > > > Please read the recent thread "What is quicker" which has a long > discussion on the limitations of floating point. > > A short summary might be, "Unless you assume that any value stored in > floating point format is only an approximation to the input value, you > will run into trouble sooner or later." If you need exact results (and > want to avoid a _lot_ of analysis), use string values or integers > (possibly scaled). > > Also, when starting a new thread, please do not just reply to an ongoing > one and change the subject. > > Gerry > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users