7 class AtanPrim
: public xtended
12 AtanPrim() : xtended("atan") {}
14 virtual unsigned int arity () { return 1; }
16 virtual bool needCache () { return true; }
18 virtual Type
infereSigType (const vector
<Type
>& args
)
20 assert (args
.size() == 1);
21 return floatCast(args
[0]);
24 virtual void sigVisit (Tree sig
, sigvisitor
* visitor
) {}
26 virtual int infereSigOrder (const vector
<int>& args
) {
31 virtual Tree
computeSigOutput (const vector
<Tree
>& args
) {
33 if (isNum(args
[0],n
)) {
34 return tree(atan(double(n
)));
36 return tree(symbol(), args
[0]);
40 virtual string
generateCode (Klass
* klass
, const vector
<string
>& args
, const vector
<Type
>& types
)
42 assert (args
.size() == arity());
43 assert (types
.size() == arity());
45 return subst("atan$1($0)", args
[0], isuffix());
48 virtual string
generateLateq (Lateq
* lateq
, const vector
<string
>& args
, const vector
<Type
>& types
)
50 assert (args
.size() == arity());
51 assert (types
.size() == arity());
53 return subst("\\arctan\\left($0\\right)", args
[0]);
59 xtended
* gAtanPrim
= new AtanPrim();