Math - handling a complicated equation including float values

I'm currently battling with the following equation:

ANSWER = A1.027 / 4.587 * 10( -0.004096 * (100 - B)1.536 + 0.01201 * C + 0.2789 * sqrt(D) - 0.09577 * sqrt(E))

I can simplify it a bit as A = 10 & B = 100 for all examples I will be calculating

C, D & E are all integer values

ANSWER is a float

I have simplified the equation to:

ANSWER = (2.23893612*(10*((0.01201 * C) + (0.2789 * sqrt(D) - (0.09577 * sqrt(E));

Suggestions on how to handle that hot mess on the Arduino?
Calculate the three lots of internal brackets and put them into floats and then use those in a final equation?

I think I worked it out.......I'll post what I came up with

Sometimes just typing out a question gives you the answer! Sorry to waste anyones time :slight_smile:

A good trick is to break up big calculations in to smaller ones and to make sure to use () to ensure you get what you want. This avoids the some times tricky rules the compiler uses.

Mark

Yeah i broke it down in excel and tested each part until i could assemble the bits and get the right answer - then moved it to my program