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
77b011c6
Commit
77b011c6
authored
Nov 09, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into sergbook.mylan:/usr/home/serg/Abk/mysql-5.0
parents
20c82f5c
1ed91ab3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
.bzrignore
.bzrignore
+1
-0
strings/decimal.c
strings/decimal.c
+10
-0
No files found.
.bzrignore
View file @
77b011c6
...
@@ -939,3 +939,4 @@ vio/test-ssl
...
@@ -939,3 +939,4 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
gdbinit
strings/decimal.c
View file @
77b011c6
...
@@ -921,6 +921,8 @@ int decimal_round(decimal *from, decimal *to, int scale, decimal_round_mode mode
...
@@ -921,6 +921,8 @@ int decimal_round(decimal *from, decimal *to, int scale, decimal_round_mode mode
*
buf1
-=
DIG_BASE
;
*
buf1
-=
DIG_BASE
;
while
(
carry
&&
--
buf1
>=
to
->
buf
)
while
(
carry
&&
--
buf1
>=
to
->
buf
)
ADD
(
*
buf1
,
*
buf1
,
0
,
carry
);
ADD
(
*
buf1
,
*
buf1
,
0
,
carry
);
if
(
to
->
buf
[
0
]
>
from
->
buf
[
0
])
to
->
intg
++
;
if
(
unlikely
(
carry
))
if
(
unlikely
(
carry
))
{
{
/* shifting the number to create space for new digit */
/* shifting the number to create space for new digit */
...
@@ -1150,6 +1152,8 @@ static int do_sub(decimal *from1, decimal *from2, decimal *to)
...
@@ -1150,6 +1152,8 @@ static int do_sub(decimal *from1, decimal *from2, decimal *to)
buf1
=
start1
+
intg1
+
frac1
;
buf1
=
start1
+
intg1
+
frac1
;
stop1
=
start1
+
intg1
+
frac2
;
stop1
=
start1
+
intg1
+
frac2
;
buf2
=
start2
+
intg2
+
frac2
;
buf2
=
start2
+
intg2
+
frac2
;
while
(
frac0
--
>
frac1
)
*--
buf0
=
0
;
while
(
buf1
>
stop1
)
while
(
buf1
>
stop1
)
*--
buf0
=*--
buf1
;
*--
buf0
=*--
buf1
;
}
}
...
@@ -1158,6 +1162,8 @@ static int do_sub(decimal *from1, decimal *from2, decimal *to)
...
@@ -1158,6 +1162,8 @@ static int do_sub(decimal *from1, decimal *from2, decimal *to)
buf1
=
start1
+
intg1
+
frac1
;
buf1
=
start1
+
intg1
+
frac1
;
buf2
=
start2
+
intg2
+
frac2
;
buf2
=
start2
+
intg2
+
frac2
;
stop2
=
start2
+
intg2
+
frac1
;
stop2
=
start2
+
intg2
+
frac1
;
while
(
frac0
--
>
frac2
)
*--
buf0
=
0
;
while
(
buf2
>
stop2
)
while
(
buf2
>
stop2
)
{
{
SUB
(
*--
buf0
,
0
,
*--
buf2
,
carry
);
SUB
(
*--
buf0
,
0
,
*--
buf2
,
carry
);
...
@@ -1968,6 +1974,7 @@ main()
...
@@ -1968,6 +1974,7 @@ main()
test_ds
(
"-123.45"
,
"-12345"
);
test_ds
(
"-123.45"
,
"-12345"
);
test_da
(
"123.45"
,
"-12345"
);
test_da
(
"123.45"
,
"-12345"
);
test_da
(
"-123.45"
,
"12345"
);
test_da
(
"-123.45"
,
"12345"
);
test_da
(
"5"
,
"-6.0"
);
printf
(
"==== decimal_mul ====
\n
"
);
printf
(
"==== decimal_mul ====
\n
"
);
test_dm
(
"12"
,
"10"
);
test_dm
(
"12"
,
"10"
);
...
@@ -2059,6 +2066,9 @@ main()
...
@@ -2059,6 +2066,9 @@ main()
test_ro
(
"-15.1"
,
0
,
CEILING
);
test_ro
(
"-15.1"
,
0
,
CEILING
);
test_ro
(
"15.1"
,
0
,
FLOOR
);
test_ro
(
"15.1"
,
0
,
FLOOR
);
test_ro
(
"-15.1"
,
0
,
FLOOR
);
test_ro
(
"-15.1"
,
0
,
FLOOR
);
test_ro
(
"999999999999999999999.999"
,
0
,
CEILING
);
test_ro
(
"-999999999999999999999.999"
,
0
,
FLOOR
);
return
0
;
return
0
;
}
}
...
...
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