Re: [sqlite] Select problem with equal compare

2008-06-09 Thread John Stanton
Alexey Pechnikov wrote: > В сообщении от Monday 09 June 2008 17:52:24 Dennis Cote написал(а): > >>If you >>consider dates to be equal when the two dates are the same to within one >>second, then you could use that value as your maximum difference. Since >>a julian day number has units of days,

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread Alexey Pechnikov
В сообщении от Monday 09 June 2008 17:52:24 Dennis Cote написал(а): > If you > consider dates to be equal when the two dates are the same to within one > second, then you could use that value as your maximum difference. Since > a julian day number has units of days, you can use a value of 1/86400

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread Dennis Cote
Alexey Pechnikov wrote: > > and compare is right, but is this correct way for date values? > Yes, this is correct, or at least expected, for date values stored as floating point julian day numbers. The binary floating point values used are the best approximations to the decimal rational

Re: [sqlite] Select problem with equal compare

2008-06-08 Thread John Stanton
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

Re: [sqlite] Select problem with equal compare

2008-06-07 Thread Alexey Pechnikov
> 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

Re: [sqlite] Select problem with equal compare

2008-06-07 Thread Gerry Snyder
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

[sqlite] Select problem with equal compare

2008-06-07 Thread Alexey Pechnikov
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. And I try sqlite> select save_date from photo_tags where save_date=2454612.21079943;