# Can i use brackets in a arduino calculation?

Thanks, David.

Hi, i am trying to write a sketch avoiding using float variables. My solution is to calculate everything in one step. Can i use brackets in my calculation so that everything is done in the right order?

Thanks, David.

Thanks, David.

ex:

finalValue = sqrt((initialValue+3.2) * 3);

is the same as:

initialValue += 3.2;

initialValue = initialValue * 3;

finalValue = sqrt(initialValue);

...same result, the compiler will break down the complex equation into steps like this...there might be some performance hit one way or the other, but it will be miniscule, and will not affect whether a floating point operation takes place.

In order to eliminate the float math we need to know what the calculation is. What is the input, and what is the desired output?