mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
decimal: *correct* implementation of ROUND_UP at last
This commit is contained in:
parent
c1a4f0c5ab
commit
104771de9a
3 changed files with 6 additions and 1 deletions
|
@ -1994,3 +1994,6 @@ select 0.000000000000000000000000000000000000000000000000001 mod 1;
|
|||
select 0.0000000001 mod 1;
|
||||
0.0000000001 mod 1
|
||||
0.0000000001
|
||||
select 0.01 mod 1;
|
||||
0.01 mod 1
|
||||
0.01
|
||||
|
|
|
@ -1579,3 +1579,5 @@ select 0.000000000000000000000000000000000000000000000000001 mod 1;
|
|||
# incorrect result
|
||||
#
|
||||
select 0.0000000001 mod 1;
|
||||
select 0.01 mod 1;
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
|
|||
|
||||
static inline int ROUND_UP(int x)
|
||||
{
|
||||
return (x + (x > 0 ? 1 : -1) * (DIG_PER_DEC1 - 1)) / DIG_PER_DEC1;
|
||||
return (x + (x > 0 ? DIG_PER_DEC1 - 1 : 0)) / DIG_PER_DEC1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_valgrind
|
||||
|
|
Loading…
Reference in a new issue