Issue Details (XML | Word | Printable)

Key: CORE-2505
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Claudio Valderrama C.
Reporter: Claudio Valderrama C.
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Built-in trigonometric functions can produce NaN and Infinity

Created: 11/Jun/09 12:17 PM   Updated: 19/Jan/16 06:18 AM
Component/s: Engine
Affects Version/s: 2.1.0, 2.5 Alpha 1, 2.1.1, 2.1.2, 2.5 Beta 2, 2.1.3, 2.5.0
Fix Version/s: 2.5 Beta 2

Environment: Platform independent
Issue Links:

QA Status: Done successfully

 Description  « Hide
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;


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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Claudio Valderrama C. added a comment - 14/Jun/09 11:43 AM
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.