Subject | Is this rounding normal? |
---|---|
Author | |
Post date | 2019-08-28T01:17:36Z |
I've just noticed that the ROUND(X, 2) function have a little problem.
The results from this query
SELECT
ROUND(CAST(0.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(1.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(2.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(3.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(4.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(5.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(6.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(7.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(8.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(9.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(10.725 AS DOUBLE PRECISION), 2)
FROM
RDB$DATABASE
ROUND(CAST(0.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(1.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(2.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(3.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(4.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(5.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(6.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(7.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(8.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(9.725 AS DOUBLE PRECISION), 2),
ROUND(CAST(10.725 AS DOUBLE PRECISION), 2)
FROM
RDB$DATABASE
are X.73, only 4.725 is rounded as 4.72.
Is this a bug in ROUND function or my IBExpert is playing tricks on me?
Maybe there are other values where it's rounded to the lower digit.
FB version 2.5.8 for Win64.