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

Built-in trigonometric functions can produce NaN and Infinity [CORE2505] #2917

Closed
firebird-automations opened this issue Jun 11, 2009 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Claudio Valderrama C. (robocop)

Assigned to: Claudio Valderrama C. (robocop)

Is related to QA404

According to the SQL standard, floating point values that aren't regular values should be considered errors. The engine shouldn't produce NaN or Infinity:

SQL> select asin(2), cot(0) from rdb$database;

               ASIN                     COT

======================= =======================
NaN Infinity

SQL> select acos(2) - acos(2) from rdb$database;

           SUBTRACT

=======================
NaN

We have two options: detect the problem once it has occurred (and give a generic message) or check the parameters. Since we know the functions we offer, the latter seems feasible.

Commits: 4cd4c52 82d2c63

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

assignee: Claudio Valderrama C. [ robocop ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

ASIN, ACOS and COT should validate its argument, EXP should validate its result, LOG10 should check the input like LN does and POWER should validate its result.

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10300 ]

Fix Version: 2.5.0 [ 10221 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 2.5.0 [ 10221 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA404 [ QA404 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

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