fix bugs with cbrt
- it was not handled in the model block - output was incorrect for MATLAB/Octave and LaTeXissue#70
parent
abbdbb5862
commit
2db2133796
|
@ -1014,6 +1014,8 @@ hand_side : '(' hand_side ')'
|
|||
{ $$ = driver.add_atan($3); }
|
||||
| SQRT '(' hand_side ')'
|
||||
{ $$ = driver.add_sqrt($3); }
|
||||
| CBRT '(' hand_side ')'
|
||||
{ $$ = driver.add_cbrt($3); }
|
||||
| ABS '(' hand_side ')'
|
||||
{ $$ = driver.add_abs($3); }
|
||||
| SIGN '(' hand_side ')'
|
||||
|
|
|
@ -2777,7 +2777,22 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
|||
output << "sqrt";
|
||||
break;
|
||||
case UnaryOpcode::cbrt:
|
||||
output << "cbrt";
|
||||
if (isMatlabOutput(output_type))
|
||||
{
|
||||
output << "nthroot(";
|
||||
arg->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
|
||||
output << ", 3)";
|
||||
return;
|
||||
}
|
||||
else if (isLatexOutput(output_type))
|
||||
{
|
||||
output << R"(\sqrt[3]{)";
|
||||
arg->writeOutput(output, output_type, temporary_terms, temporary_terms_idxs, tef_terms);
|
||||
output << "}";
|
||||
return;
|
||||
}
|
||||
else
|
||||
output << "cbrt";
|
||||
break;
|
||||
case UnaryOpcode::abs:
|
||||
output << "abs";
|
||||
|
|
Loading…
Reference in New Issue