Power of number (pow) calculation in rules
Posted: 01 Dec 2022, 13:04
I was wondering if it is possible to calculate the power of a number in rules.
E.g. 2^x
E.g. 2^x
Have fun with controlling everything!
https://letscontrolit.com/forum/
Code: Select all
double RulesCalculate_t::apply_operator(char op, double first, double second)
{
switch (op)
{
case '+':
return first + second;
case '-':
return first - second;
case '*':
return first * second;
case '/':
return first / second;
case '%':
return static_cast<int>(round(first)) % static_cast<int>(round(second));
case '^':
return pow(first, second);
default:
return 0.0;
}
}
Code: Select all
pip3 install -r requirements.txt
Code: Select all
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
source/Plugin/AdaGFX_commands.repl:45: WARNING: undefined label: p123_page
source/Plugin/AdaGFX_values.repl:6: WARNING: undefined label: p096_page
source/Plugin/AdaGFX_commands.repl:45: WARNING: undefined label: p123_page
source/Plugin/AdaGFX_commands.repl:45: WARNING: undefined label: p123_page
source/Plugin/AdaGFX_commands.repl:45: WARNING: undefined label: p123_page
source/Plugin/AdaGFX_values.repl:6: WARNING: undefined label: p096_page
source/Plugin/AdaGFX_commands.repl:45: WARNING: undefined label: p123_page
generating indices... genindex done
writing additional pages... search done
copying images... [100%] Tools/images/SettingsArchive_provisioning.png
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 7 warnings.