repo.or.cz
/
eigenmath-fx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git]
/
ceiling.cpp
blob
b396ff3415726bae44b81a31a37f6b763f37afd2
1
#include
"stdafx.h"
2
#include
"defs.h"
3
4
void
5
eval_ceiling
(
void
)
6
{
7
push
(
cadr
(
p1
));
8
eval
();
9
ceiling
();
10
}
11
12
void
13
ceiling
(
void
)
14
{
15
save
();
16
yyceiling
();
17
restore
();
18
}
19
20
void
21
yyceiling
(
void
)
22
{
23
double
d
;
24
25
p1
=
pop
();
26
27
if
(!
isnum
(
p1
)) {
28
push_symbol
(
CEILING
);
29
push
(
p1
);
30
list
(
2
);
31
return
;
32
}
33
34
if
(
isdouble
(
p1
)) {
35
d
=
ceil
(
p1
->
u
.
d
);
36
push_double
(
d
);
37
return
;
38
}
39
40
if
(
isinteger
(
p1
)) {
41
push
(
p1
);
42
return
;
43
}
44
45
p3
=
alloc
();
46
p3
->
k
=
NUM
;
47
p3
->
u
.
q
.
a
=
mdiv
(
p1
->
u
.
q
.
a
,
p1
->
u
.
q
.
b
);
48
p3
->
u
.
q
.
b
=
mint
(
1
);
49
push
(
p3
);
50
51
if
(
isnegativenumber
(
p1
))
52
;
53
else
{
54
push_integer
(
1
);
55
add
();
56
}
57
}