Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
firebird-automations opened this issue Mar 24, 2021 · 4 comments
Closed

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

firebird-automations opened this issue Mar 24, 2021 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0.0 [ 10931 ]

Fix Version: 3.0.8 [ 10960 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants