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
b12dfea6
Commit
b12dfea6
authored
Nov 04, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0/
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
parents
f60e488c
d117bf31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
strings/decimal.c
strings/decimal.c
+29
-3
No files found.
strings/decimal.c
View file @
b12dfea6
...
...
@@ -579,18 +579,44 @@ int decimal2bin(decimal *from, char *to, int precision, int frac)
{
dec1
mask
=
from
->
sign
?
-
1
:
0
,
*
buf1
=
from
->
buf
,
*
stop1
;
int
error
=
E_DEC_OK
,
intg
=
precision
-
frac
,
isize1
,
intg1
,
intg1x
=
from
->
intg
,
intg0
=
intg
/
DIG_PER_DEC1
,
frac0
=
frac
/
DIG_PER_DEC1
,
intg0x
=
intg
-
intg0
*
DIG_PER_DEC1
,
frac0x
=
frac
-
frac0
*
DIG_PER_DEC1
,
intg1
=
from
->
intg
/
DIG_PER_DEC1
,
frac1
=
from
->
frac
/
DIG_PER_DEC1
,
intg1x
=
from
->
intg
-
intg1
*
DIG_PER_DEC1
,
frac1x
=
from
->
frac
-
frac1
*
DIG_PER_DEC1
,
isize0
=
intg0
*
sizeof
(
dec1
)
+
dig2bytes
[
intg0x
],
fsize0
=
frac0
*
sizeof
(
dec1
)
+
dig2bytes
[
frac0x
],
isize1
=
intg1
*
sizeof
(
dec1
)
+
dig2bytes
[
intg1x
],
fsize1
=
frac1
*
sizeof
(
dec1
)
+
dig2bytes
[
frac1x
];
/* removing leading zeroes */
intg1
=
((
intg1x
-
1
)
%
DIG_PER_DEC1
)
+
1
;
while
(
intg1x
>
0
&&
*
buf1
==
0
)
{
intg1x
-=
intg1
;
intg1
=
DIG_PER_DEC1
;
buf1
++
;
}
if
(
intg1x
>
0
)
{
for
(
intg1
=
(
intg1x
-
1
)
%
DIG_PER_DEC1
;
*
buf1
<
powers10
[
intg1
--
];
intg1x
--
)
;
DBUG_ASSERT
(
intg1x
>
0
);
}
else
intg1x
=
0
;
if
(
unlikely
(
intg1x
+
fsize1
==
0
))
{
mask
=
0
;
/* just in case */
intg
=
1
;
buf1
=&
mask
;
}
intg1
=
intg1x
/
DIG_PER_DEC1
;
intg1x
=
intg1x
-
intg1
*
DIG_PER_DEC1
;
isize1
=
intg1
*
sizeof
(
dec1
)
+
dig2bytes
[
intg1x
];
if
(
isize0
<
isize1
)
{
buf1
+=
intg1
-
intg0
+
(
intg1x
>
0
)
-
(
intg0x
>
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