Firebird supports the special floating point value Infinity and -Infinity as DOUBLE PRECISION values:
select log(1, 1), log(1, 0.5), log(1, 1.5) from RDB$DATABASE
This yields
|LOG|LOG |LOG |
|---|---------|---------|
|NaN|-Infinity|+Infinity|
The trick using LOG() with base 1 is documented here. While NaN also exists as a FLOAT value:
select cast(log(1, 1) as float) from RDB$DATABASE
The infinities can't be cast to FLOAT:
select cast(log(1, 1.5) as float) from RDB$DATABASE
I'm getting:
SQL Error [335544916] [22003]: arithmetic exception, numeric overflow, or string truncation; numeric value is out of range [SQLState:22003, ISC error code:335544916]
Is there any documented or undocumented way to get infinities of type FLOAT in Firebird?