Use integers if you want to assign a specific scale and precision.

Because floating point numbers are an approximation you can enforce a 
certain precision by calculating differences.  You cannot use equality 
with FP but you can decide that equality is when (A - B) < |N| where N 
is the precision and || absolute value.

MoDementia wrote:
> After experiencing some difficulty with comparing dates stored internally as
> a floating point I was informed about the following.
> 
> "... due to the way floats are stored in computers, '=' isn't really a good
> choice of an operator for them. 
> Instead of
> 
> Date = 38953.5890509
> 
> you should use
> 
> Date > 38953.5890508 AND Date < 38953.5890510"
> 
> Is there any way to set a precision value? 10 or 12 even 8 decimal places
> would be fine in this instance for SQLite "REAL" data so that what is "seen"
> can be compared without surprises?
> 
> _______________________________________________
> 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

Reply via email to