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
dc2e9d01
Commit
dc2e9d01
authored
Dec 06, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
int decimal_is_zero(decimal *from);
parent
566b0707
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
include/decimal.h
include/decimal.h
+1
-7
strings/decimal.c
strings/decimal.c
+10
-0
No files found.
include/decimal.h
View file @
dc2e9d01
...
...
@@ -51,13 +51,7 @@ int decimal_mul(decimal *from1, decimal *from2, decimal *to);
int
decimal_div
(
decimal
*
from1
,
decimal
*
from2
,
decimal
*
to
,
int
scale_incr
);
int
decimal_mod
(
decimal
*
from1
,
decimal
*
from2
,
decimal
*
to
);
int
decimal_round
(
decimal
*
from
,
decimal
*
to
,
int
new_scale
,
decimal_round_mode
mode
);
/*
the following works only on special "zero" decimal, not on any
decimal that happen to evaluate to zero
*/
#define decimal_is_zero(dec) ((dec)->intg1==1 && (dec)->frac1==0 && (dec)->buf[0]==0)
int
decimal_is_zero
(
decimal
*
from
);
/* set a decimal to zero */
...
...
strings/decimal.c
View file @
dc2e9d01
...
...
@@ -1240,6 +1240,16 @@ int decimal_cmp(decimal *from1, decimal *from2)
return
from1
->
sign
>
from2
->
sign
?
-
1
:
1
;
}
int
decimal_is_zero
(
decimal
*
from
)
{
dec1
*
buf1
=
from
->
buf
,
*
end
=
buf1
+
ROUND_UP
(
from
->
intg
)
+
ROUND_UP
(
from
->
frac
);
while
(
buf1
<
end
)
if
(
*
buf1
++
)
return
0
;
return
1
;
}
/*
multiply two decimals
...
...
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