repo.or.cz
/
frameshot.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
More basics.
[frameshot.git]
/
utils.c
blob
95a105908bffd6189f7434ac60ac1cc101e6f2f9
1
#include
"utils.h"
2
3
void
reduce_fraction
(
int
*
n
,
int
*
d
)
4
{
5
int
a
= *
n
;
6
int
b
= *
d
;
7
int
c
;
8
if
( !
a
|| !
b
)
9
return
;
10
c
=
a
%
b
;
11
while
(
c
)
12
{
13
a
=
b
;
14
b
=
c
;
15
c
=
a
%
b
;
16
}
17
*
n
/=
b
;
18
*
d
/=
b
;
19
}