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
Operations

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: 07/Jun/11 10:40 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

Time Tracking:
Not Specified

Environment: Platform independent
Issue Links:
Relate
 

Planning Status: Unspecified


 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;

               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.


 All   Comments   Work Log   Change History   Version Control   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.