Subject CAST doesn't work in SELECT
Author Rick Debay
A simple example is

SELECT
(CAST (d.RDB$RELATION_ID) AS DOUBLE)
FROM
RDB$DATABASE d

The reason why I want to do a CAST in a SELECT is because I have a VIEW
with a computed column that is having rounding issues, and I'm hoping
that expanding all data types to DOUBLE might reduce the error.

The computation is:

((DECIMAL(9,2) * DECIMAL(12,3)) / DECIMAL(12,3)) - ((DECIMAL(18,2) *
DECIMAL(12,3)) / DECIMAL(12,3))

And I wanted to try CASTing each element to DOUBLE, and hope I get a
greater precision.