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
bc76b823
Commit
bc76b823
authored
Nov 01, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct test for 1/3
more tests
parent
e933ae7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
strings/decimal.c
strings/decimal.c
+4
-1
No files found.
strings/decimal.c
View file @
bc76b823
...
@@ -1318,7 +1318,7 @@ static int do_div_mod(decimal *from1, decimal *from2,
...
@@ -1318,7 +1318,7 @@ static int do_div_mod(decimal *from1, decimal *from2,
if
((
scale_incr
-=
frac1
-
from1
->
frac
+
frac2
-
from2
->
frac
)
<
0
)
if
((
scale_incr
-=
frac1
-
from1
->
frac
+
frac2
-
from2
->
frac
)
<
0
)
scale_incr
=
0
;
scale_incr
=
0
;
if
((
i
=
(
prec1
-
frac1
)
-
(
prec2
-
frac2
)
+
1
)
<
0
)
/* see below */
if
((
i
=
(
prec1
-
frac1
)
-
(
prec2
-
frac2
)
+
(
*
buf1
>
*
buf2
)
)
<
0
)
/* see below */
intg0
=
0
;
intg0
=
0
;
else
else
intg0
=
ROUND_UP
(
i
);
intg0
=
ROUND_UP
(
i
);
...
@@ -1940,6 +1940,8 @@ main()
...
@@ -1940,6 +1940,8 @@ main()
test_dv
(
"-12193185.1853376"
,
"98765.4321"
);
test_dv
(
"-12193185.1853376"
,
"98765.4321"
);
test_dv
(
"121931851853376"
,
"987654321"
);
test_dv
(
"121931851853376"
,
"987654321"
);
test_dv
(
"0"
,
"987"
);
test_dv
(
"0"
,
"987"
);
test_dv
(
"1"
,
"3"
);
test_dv
(
"1.000000000000"
,
"3"
);
printf
(
"==== decimal_round ====
\n
"
);
printf
(
"==== decimal_round ====
\n
"
);
test_ro
(
"15.1"
,
0
,
HALF_UP
);
test_ro
(
"15.1"
,
0
,
HALF_UP
);
...
@@ -1965,6 +1967,7 @@ main()
...
@@ -1965,6 +1967,7 @@ main()
test_ro
(
"5678.123451"
,
4
,
TRUNCATE
);
test_ro
(
"5678.123451"
,
4
,
TRUNCATE
);
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
);
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