X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finput_parser.yy;h=74beb4c54f44464ff78ccfd97f726186b384269f;hp=8601524c1dbbe5d2c31c556fc2d947cf08343e98;hb=836d606a1657629dcd7fb1b763e21dd296e9b164;hpb=619d77d2676f7f1a562fb9fefc0ba6754fe2d750 diff --git a/ginac/input_parser.yy b/ginac/input_parser.yy index 8601524c..74beb4c5 100644 --- a/ginac/input_parser.yy +++ b/ginac/input_parser.yy @@ -105,6 +105,10 @@ exp : T_NUMBER {$$ = $1;} if ($3.nops() != 1) throw (std::runtime_error("too many arguments to sqrt()")); $$ = sqrt($3.op(0)); + } else if (n == "pow" || n == "power") { + if ($3.nops() != 2) + throw std::invalid_argument("wrong number of arguments to pow()"); + $$ = power($3.op(0), $3.op(0)); } else { unsigned i = function::find_function(n, $3.nops()); $$ = function(i, ex_to($3)).eval(1);