|
|
There is a long broken (back to v3.7 at least) sqr() function
implementation sitting in our code.
The fix in my povr (near v3.8) code base was done all in the
source/parser directory.
In the files reservedwords.h and reservedwords.cpp move SQR_TOKEN to be
just above SQRT_TOKEN. The order matters in this case.
Plus, in parser_functions.cpp, add the lines:
case SQR_TOKEN:
result = pow(node->child->number,2.0);
break;
adjacent to those for the SQRT_TOKEN code.
Once fixed, sqr() will work both in the parser and within functions at
parse time or run time.
Aside: In regular releases I believe there was a f_sqr() function
defined. In the povr fork this now a munction resulting in an F_sqr
function being defined/compiled.
Bill P.
Post a reply to this message
|
|