Subject Re: [firebird-support] Re: Is this a bug in ROUND function?
Author Slavomir Skopalik

For exact numbers you have to use exact numeric types.

Double is float point type with all advantages and disadvantages.

Look here

Just for fun, try this:

1e20 + 1 + 1 - 1e20 + 1


Ing. Slavomir Skopalik
Executive Head
Elekt Labs s.r.o.
MASA - Collection and evaluation of data from machines and laboratories
Elekt Labs s.r.o.
Chaloupky 158
783 72 Velky Tynec
Czech Republic
Mobile: +420 724 207 851
icq:199 118 333
On 29.08.19 13:45, m.djorov@... [firebird-support] wrote:
In binary representation of the values maybe 4.72 is the closest, but we are talking about mathematic.
This is from the description of the ROUND function in the documentation:
Rounds a number to the nearest integer. If the fractional part is exactly 0.5, rounding is upward for positive numbers and downward for negative numbers.
So .725 is all cases is rounded up to .73 as it should be, but in one case it is not.

Posted by: m.djorov@...
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)