What is the operator for an exponent? The operator I am accustomed to mean an exponent is the bitwise XOR in C. In my class object ExternPWM mentioned under a different topic I had to code a loop to derive and exponent. I'm sure there has to be a language equivelant to x to the y.
I'm sure there has to be a language equivelant to x to the y.
On the Arduino, there is the pow() function. It's arguments are all floats, though, so it's accuracy when supplied with integer arguments leaves a bit to be desired.
There is no function-equivalent for integers.
If x and y are integers then you'd be a lot faster and more accurate looping through integer multiplies than using floats. Arduino float and double are both 4-byte and there is no FPU.
Then my workaround seems to be the best approach, as I am calculating 2 to the nth. where nth is the number of stages used between the timebase and the output gate.
For 2n, use 1 << n
, assuming n is a positive integer
Thanks AWOL! Seems alot better than up to 14 trips through a 2*lasttrip.