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

DECFLOAT: subtraction Num1 - Num2 leads to "Decimal float overflow" if Num2 is specified in scientific notation and less than max double ( 1.7976931348623157e308 ) [CORE6238] #6482

Closed
firebird-issue-importer opened this issue Jan 28, 2020 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Example-1:

SQL> select (d -1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database);

Result: 9.999999999999999999999999999999998E+6144 // OK, Expected

Example-2:

SQL> select (d - 1e0) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database);

Result:
Statement failed, SQLSTATE = 22003
Decimal float overflow. The exponent of a result is greater than the magnitude allowed.

PS.
It seems that MINIMAL abs value in scientific notation that can be subtracted from 9.99e+6144 is 0x 7FEF FFFF FFFF FFFF, i.e. 1.7976931348623157e308 (max double):

SQL> select (d-1.79769314e308) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database);

9.999999999999999999999999999999998E+6144

=== vs ===

SQL> select (d-1.79769313e308) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database);

Statement failed, SQLSTATE = 22003
Decimal float overflow. The exponent of a result is greater than the magnitude allowed.

Commits: 0ef5a1a 9e6c6d0

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 30, 2020

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 31, 2020

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 31, 2020

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants