Issue Details (XML | Word | Printable)

Key: CORE-3201
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Paul Vinkenoog
Votes: 0
Watchers: 0

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

ATAN2 returns incorrect value for (0, 0)

Created: 27/Oct/10 04:13 PM   Updated: 23/Sep/15 12:57 PM
Component/s: Engine
Affects Version/s: 2.1.3, 2.5.0
Fix Version/s: 3.0 Alpha 1

Issue Links:

QA Status: Done successfully

 Description  « Hide
The internal function ATAN2(0, 0) returns 0.000000

This is incorrect, as (0, 0) doesn't define a tangent, not even an "infinite" one like e.g. (3, 0) does.
If both arguments are 0, an exception should be raised or NaN returned.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 02/Feb/11 03:22 PM
I first created a new message "Arguments for @1 cannot be simultaneously zero". Then I saw Oracle gives "Evaluation of an value expression causes an overflow/underflow".

We already have "Floating point overflow in built-in function @1".

What's the better message to use?

Paul Vinkenoog added a comment - 02/Feb/11 03:43 PM
I strongly suggest the separate message, although I would rephrase it as "Arguments for @1 cannot both be zero" (or: "...may not both be zero").

There's no question of over- or underflow here, or division by zero -- just of something being undefined.

Also, the separate message is very clear to the user. The other messages might still leave him wondering what he did wrong.

Paul Vinkenoog added a comment - 04/Feb/11 02:47 PM
How about 2.1.5 and 2.5.1 ?

Pavel Cisar added a comment - 23/Sep/15 12:57 PM
Test created.