LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
52 stars 24 forks source link

[FRG-150] modulo function takes real values as arguments and returns wrong results #722

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[reporter="kvu", created="Fri, 9 Jun 2006 11:47:17 -0500 (GMT-05:00)"] SQL2003 Part2 Section 6.27, Syntax Rules 9:
"If is specified, then the declared type of each shall be
exact numeric with scale 0 (zero). The declared type of the result is the declared type of the immediately
contained ."

-- on luciddb:
values mod(2.3,5), mod(2.4,5), mod(2.5,5), mod(2.6,5);

-- results:
+---------+
| EXPR$0 |
+---------+
| 3 |
| 4 |
| 0 |
| 1 |
+---------+

dynamobi-build commented 12 years ago

[author="jvs", created="Mon, 12 Jun 2006 12:20:11 -0500 (GMT-05:00)"] At first I was mystified by the results. Then I imagined what would happen if I ignored the decimal point...

dynamobi-build commented 12 years ago

[author="jpham", created="Wed, 14 Jun 2006 12:19:13 -0500 (GMT-05:00)"] I put in more validation as of lu change 6903