summaryrefslogtreecommitdiff
path: root/cad/src/experimental/pyrex-atoms-bonds/iguana/ops.b
blob: b6e223e17dd9b7318082ed50a75e53599b24aaf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
dup # x # x x
rot # x y z # y z x
drop # x #
over # x y # x y x
swap # x y # y x
pick # n # self->data_stack[self->dspointer-(int)n-1]


eq = # x y # ((double)(x==y))
less < # x y # ((double)(x<y))
lesseq <= # x y # ((double)(x<=y))
greater > # x y # ((double)(x>y))
greatereq >= # x y # ((double)(x>=y))


and # x y # (double)(((int)x)&((int)y))
or # x y # (double)(((int)x)|((int)y))
not # x # (double)(!((int)x))


add + # x y # x+y
sub - # x y # x-y
mul * # x y # x*y
div / # x y # x/y # ASSERT(y != 0);
mod % # x y # x+y # ASSERT(y != 0);


exp ** # x # exp(x)
ln # x # log(x)
pow # x y # exp(y*log(x))
sin # x # sin(x)
cos # x # cos(x)
tan # x # tan(x)


print # x # # printf("%.12f ", x);
println # x # # printf("%.12f\n", x);
newline # # # printf("\n");
ouch # # # PyErr_SetString(IguanaError, "ouch"); return EVILRETURN;