Inherits xtended.
Public Member Functions | |
| RemainderPrim () | |
| virtual unsigned int | arity () |
| virtual bool | needCache () |
| virtual Type | infereSigType (const vector< Type > &args) |
| virtual void | sigVisit (Tree sig, sigvisitor *visitor) |
| virtual int | infereSigOrder (const vector< int > &args) |
| virtual Tree | computeSigOutput (const vector< Tree > &args) |
| virtual string | generateCode (Klass *klass, const vector< string > &args, const vector< Type > &types) |
| virtual string | generateLateq (Lateq *lateq, const vector< string > &args, const vector< Type > &types) |
Definition at line 8 of file remainderprim.cpp.
| RemainderPrim::RemainderPrim | ( | ) | [inline] |
Definition at line 13 of file remainderprim.cpp.
00013 : xtended("remainder") {}
| virtual unsigned int RemainderPrim::arity | ( | ) | [inline, virtual] |
Implements xtended.
Definition at line 15 of file remainderprim.cpp.
Referenced by computeSigOutput(), generateCode(), generateLateq(), infereSigOrder(), and infereSigType().
Implements xtended.
Definition at line 33 of file remainderprim.cpp.
References arity(), isNum(), xtended::symbol(), and tree().
00033 { 00034 num n,m; 00035 assert (args.size() == arity()); 00036 if (isNum(args[0],n) & isNum(args[1],m)) { 00037 return tree(remainder(double(n), double(m))); 00038 } else { 00039 return tree(symbol(), args[0], args[1]); 00040 } 00041 }
| virtual string RemainderPrim::generateCode | ( | Klass * | klass, | |
| const vector< string > & | args, | |||
| const vector< Type > & | types | |||
| ) | [inline, virtual] |
Implements xtended.
Definition at line 43 of file remainderprim.cpp.
References arity(), isuffix(), and subst().
00044 { 00045 assert (args.size() == arity()); 00046 assert (types.size() == arity()); 00047 00048 return subst("remainder$2($0,$1)", args[0], args[1], isuffix()); 00049 }
| virtual string RemainderPrim::generateLateq | ( | Lateq * | lateq, | |
| const vector< string > & | args, | |||
| const vector< Type > & | types | |||
| ) | [inline, virtual] |
Implements xtended.
Definition at line 51 of file remainderprim.cpp.
References arity(), and subst().
00052 { 00053 assert (args.size() == arity()); 00054 assert (types.size() == arity()); 00055 00056 return subst("$0\\pmod{$1}", args[0], args[1]); // Same as fmodprim.cpp. 00057 }
| virtual int RemainderPrim::infereSigOrder | ( | const vector< int > & | args | ) | [inline, virtual] |
Implements xtended.
Definition at line 19 of file remainderprim.cpp.
References arity(), castInterval(), and floatCast().
00020 { 00021 assert (args.size() == arity()); 00022 return castInterval(floatCast(args[0]|args[1]), interval()); // temporary rule !!! 00023 }
| virtual bool RemainderPrim::needCache | ( | ) | [inline, virtual] |
| virtual void RemainderPrim::sigVisit | ( | Tree | sig, | |
| sigvisitor * | visitor | |||
| ) | [inline, virtual] |
Definition at line 25 of file remainderprim.cpp.
1.6.3