Precalculation of float operations in code
Asked by
benjamin
Hello,
I noticed that the following code :
int v1,v2;
v1 = v2*3*4;
will produce the same output as
int v1,v2;
v1 = v2*12;
but with floats, two separate calls to __aeabi_fmul are made in the first case against only one in the second one.
On the otherside, when putting the operations in defines, the preprocessor precompute the (3.f*4.f) part and so only one call to __aeabi_fmul is issued.
Is it possible to precompute float operations in code in the same way it is done with integers or by the preprocessor?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- benjamin
- Solved:
- Last query:
- Last reply:
To post a message you must log in.