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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c0a4183b
Commit
c0a4183b
authored
Dec 03, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strings/decimal.c
decimal_round(d, -N) bug fixed
parent
44dce267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
strings/decimal.c
strings/decimal.c
+7
-0
No files found.
strings/decimal.c
View file @
c0a4183b
...
...
@@ -921,6 +921,12 @@ int decimal_round(decimal *from, decimal *to, int scale, decimal_round_mode mode
x
+=
10
;
*
buf1
=
powers10
[
pos
]
*
(
x
-
y
);
}
if
(
frac0
<
0
)
{
dec1
*
end
=
to
->
buf
+
intg0
,
*
buf
=
buf1
+
1
;
while
(
buf
<
end
)
*
buf
++=
0
;
}
if
(
*
buf1
>=
DIG_BASE
)
{
carry
=
1
;
...
...
@@ -2083,6 +2089,7 @@ main()
test_ro
(
"5678.123451"
,
5
,
TRUNCATE
,
"5678.12345"
);
test_ro
(
"5678.123451"
,
6
,
TRUNCATE
,
"5678.123451"
);
test_ro
(
"-5678.123451"
,
-
4
,
TRUNCATE
,
"0"
);
memset
(
buf2
,
33
,
sizeof
(
buf2
));
test_ro
(
"99999999999999999999999999999999999999"
,
-
31
,
TRUNCATE
,
"99999990000000000000000000000000000000"
);
test_ro
(
"15.1"
,
0
,
HALF_UP
,
"15"
);
test_ro
(
"15.5"
,
0
,
HALF_UP
,
"16"
);
...
...
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