Maths calc - a var raised to a power - help please
Posted: Thu Jul 28, 2022 3:40 pm
I need to do a maths calculation with one variable raised to the power of another variable like x^y.
In c code it would be something along the lines of the following using the pow function
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[])
{
/* Define temporary variables */
REALvar1, REALvar2;
resultVAR;
/* Assign the values we will use for the pow calculation */
REALvar1 = 4;
REALvar2 = 2;
/* Calculate the result of REALvar1 raised to the power of REALvar2 */
resultVAR = pow(REALvar1, REALvar2);
I'm using float REAL variables in a 16 bit uC and just wondering how it could be handled in Flowcode?
Is it as simple as using the ^ operator or do I use something like pow? An example would be appreciated.
In c code it would be something along the lines of the following using the pow function
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[])
{
/* Define temporary variables */
REALvar1, REALvar2;
resultVAR;
/* Assign the values we will use for the pow calculation */
REALvar1 = 4;
REALvar2 = 2;
/* Calculate the result of REALvar1 raised to the power of REALvar2 */
resultVAR = pow(REALvar1, REALvar2);
I'm using float REAL variables in a 16 bit uC and just wondering how it could be handled in Flowcode?
Is it as simple as using the ^ operator or do I use something like pow? An example would be appreciated.