Skip to content

CAST of Infinity values to FLOAT doesn't work [CORE6521] #6750

@firebird-automations

Description

@firebird-automations

Submitted by: Lukas Eder (lukas.eder)

According to the docs:
https://firebirdsql.org/refdocs/langrefupd25-intfunc-log.html

This is how NaN, +Infinity, and -Infinity values of type DOUBLE PRECISION are created:

select log\(1, 1\), log\(1, 0\.5\), log\(1, 1\.5\) from RDB$DATABASE

It's possible to get a NaN value of type FLOAT:

select cast\(log\(1, 1\) as float\) from RDB$DATABASE

But infinities cannot be cast to FLOAT:

select cast\(log\(1, 1\.5\) as float\) from RDB$DATABASE

This is producing an error:

> SQL Error [335544916] [22003]: arithmetic exception, numeric overflow, or string truncation; numeric value is out of range [SQLState:22003, ISC error code:335544916]

See also this Stack Overflow question:
https://stackoverflow.com/q/66763171/521799

Commits: 2ec5134 a640e2f

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions