Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ea69fe30
Commit
ea69fe30
authored
Nov 02, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ROUND_UP(negative_number) doesn't work
parent
5dce4d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
strings/decimal.c
strings/decimal.c
+3
-1
No files found.
strings/decimal.c
View file @
ea69fe30
...
@@ -818,7 +818,8 @@ int decimal_bin_size(int precision, int scale)
...
@@ -818,7 +818,8 @@ int decimal_bin_size(int precision, int scale)
int
decimal_round
(
decimal
*
from
,
decimal
*
to
,
int
scale
,
decimal_round_mode
mode
)
int
decimal_round
(
decimal
*
from
,
decimal
*
to
,
int
scale
,
decimal_round_mode
mode
)
{
{
int
frac0
=
ROUND_UP
(
scale
),
frac1
=
ROUND_UP
(
from
->
frac
),
int
frac0
=
scale
>
0
?
ROUND_UP
(
scale
)
:
scale
/
DIG_PER_DEC1
,
frac1
=
ROUND_UP
(
from
->
frac
),
intg0
=
ROUND_UP
(
from
->
intg
),
error
=
E_DEC_OK
,
len
=
to
->
len
;
intg0
=
ROUND_UP
(
from
->
intg
),
error
=
E_DEC_OK
,
len
=
to
->
len
;
dec1
*
buf0
=
from
->
buf
,
*
buf1
=
to
->
buf
,
x
,
y
,
carry
=
0
;
dec1
*
buf0
=
from
->
buf
,
*
buf1
=
to
->
buf
,
x
,
y
,
carry
=
0
;
...
@@ -1976,6 +1977,7 @@ main()
...
@@ -1976,6 +1977,7 @@ main()
test_ro
(
"5678.123451"
,
5
,
TRUNCATE
);
test_ro
(
"5678.123451"
,
5
,
TRUNCATE
);
test_ro
(
"5678.123451"
,
6
,
TRUNCATE
);
test_ro
(
"5678.123451"
,
6
,
TRUNCATE
);
test_ro
(
"-5678.123451"
,
-
4
,
TRUNCATE
);
test_ro
(
"-5678.123451"
,
-
4
,
TRUNCATE
);
test_ro
(
"99999999999999999999999999999999999999"
,
-
31
,
TRUNCATE
);
printf
(
"==== decimal_mod ====
\n
"
);
printf
(
"==== decimal_mod ====
\n
"
);
test_md
(
"234"
,
"10"
);
test_md
(
"234"
,
"10"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment