From: Mark R. <ma...@la...> - 2012-11-01 13:40:31
|
On Thu, 01 Nov 2012 14:32:35 +0100, Dimitry Sibiryakov <sd...@ib...> wrote: > 01.11.2012 14:26, Dmitry Yemanov wrote: >> The obvious one (though not necessarily meaning the only one) is to have >> even longer numerics and use them in cases when an int64 based >> intermediate result is likely to overflow. > > Way to nowhere. No matter how long new datatype is, 1/3 won't be > precise. > > IMHO, division should produce double precision result. Always. IMHO it shouldn't and afaik the SQL standard agrees with me here. For most calculations double is less precise than the existing NUMERIC/DECIMAL calculations, not to mention BCD solutions with larger sizes and scales. For example: there is no precise result of 1/10 in double: http://www.math.okstate.edu/~yqwang/teaching/math4513_fall12/Notes/0point1.pdf If you want double, use double, but don't force its imprecision where it isn't needed. Mark |