Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
5734203d
Commit
5734203d
authored
4 years ago
by
Florian Prill
Browse files
Options
Downloads
Patches
Plain Diff
[event_generic_review] fixed inconsistent naming.
parent
c47259c7
No related branches found
No related tags found
1 merge request
!3
WIP: Event generic
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/int_div_example.c
+2
-2
2 additions, 2 deletions
examples/int_div_example.c
include/int_div.h
+1
-1
1 addition, 1 deletion
include/int_div.h
src/int_div.c
+6
-6
6 additions, 6 deletions
src/int_div.c
with
9 additions
and
9 deletions
examples/int_div_example.c
+
2
−
2
View file @
5734203d
...
...
@@ -91,8 +91,8 @@ int main(void) {
/* additional calls (test interfaces). */
t_number
p1
;
/* dividend */
convert_basis
(
day_fraction1
*
(
t_int
)
20
,
&
p1
,
2
,
0
);
convert_basis
(
days1
,
&
p1
,
W_DIGITS
-
3
,
3
);
convert_
to_
basis
(
day_fraction1
*
(
t_int
)
20
,
&
p1
,
2
,
0
);
convert_
to_
basis
(
days1
,
&
p1
,
W_DIGITS
-
3
,
3
);
print_number
(
p1
);
printf
(
"test program done after %d tests.
\n
"
,
NREPEAT
);
...
...
This diff is collapsed.
Click to expand it.
include/int_div.h
+
1
−
1
View file @
5734203d
...
...
@@ -36,7 +36,7 @@ int smaller(const t_number r, const t_number dq, const int k, const int
void
difference
(
t_number
*
r
,
const
t_number
dq
,
const
int
k
,
const
int
m
,
const
t_int
b
,
int
*
ret
);
int
division
(
const
t_number
x
,
const
t_number
y
,
t_number
*
q
,
t_number
*
r
,
const
t_int
b
);
void
convert_basis
(
const
t_int
v_in
,
t_number
*
v_out
,
const
int
digits
,
const
int
istart
);
void
convert_
to_
basis
(
const
t_int
v_in
,
t_number
*
v_out
,
const
int
digits
,
const
int
istart
);
t_int
convert_to_decimal
(
const
t_number
v_in
,
const
int
istart
,
const
int
iend
);
int
divide_timespan
(
const
t_int
days1
,
const
t_int
day_fraction1
,
...
...
This diff is collapsed.
Click to expand it.
src/int_div.c
+
6
−
6
View file @
5734203d
...
...
@@ -170,8 +170,8 @@ int division(const t_number x, const t_number y,
/* convert to basis "b" by a succession of Euclidean divisions, stores to v_out[istart...]. */
void
convert_basis
(
const
t_int
v_in
,
t_number
*
v_out
,
const
int
digits
,
const
int
istart
)
{
void
convert_
to_
basis
(
const
t_int
v_in
,
t_number
*
v_out
,
const
int
digits
,
const
int
istart
)
{
int
i
;
t_int
v
=
v_in
;
for
(
i
=
digits
;
i
>=
0
;
i
--
)
{
...
...
@@ -220,10 +220,10 @@ int divide_timespan(const t_int days1, const t_int day_fraction1,
if
((
day_fraction1
>
msecs_day
)
||
(
day_fraction2
>
msecs_day
))
printf
(
"Fail 1
\n
"
);
if
((
day_fraction1
>
msecs_day
)
||
(
day_fraction2
>
msecs_day
))
return
Fail
;
convert_basis
(
day_fraction1
*
(
t_int
)
20
,
&
p1
,
2
,
0
);
convert_basis
(
days1
,
&
p1
,
W_DIGITS
-
3
,
3
);
convert_basis
(
day_fraction2
*
(
t_int
)
20
,
&
p2
,
2
,
0
);
convert_basis
(
days2
,
&
p2
,
W_DIGITS
-
3
,
3
);
convert_
to_
basis
(
day_fraction1
*
(
t_int
)
20
,
&
p1
,
2
,
0
);
convert_
to_
basis
(
days1
,
&
p1
,
W_DIGITS
-
3
,
3
);
convert_
to_
basis
(
day_fraction2
*
(
t_int
)
20
,
&
p2
,
2
,
0
);
convert_
to_
basis
(
days2
,
&
p2
,
W_DIGITS
-
3
,
3
);
ret
=
division
(
p1
,
p2
,
&
q
,
&
r
,
(
t_int
)
1200
);
/* perform division. */
...
...
This diff is collapsed.
Click to expand it.
Florian Prill
@m300196
mentioned in merge request
!3 (closed)
·
4 years ago
mentioned in merge request
!3 (closed)
mentioned in merge request !3
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment