Well ... if we were talking about integrals , the answer would be a clear yes (under the general term Constant Folding). Even long calculations can be performed at compile time ... and this is actually required to evaluate the parameters of non-config parameters of templates and (now) constexpr.
, . , (, , ) .
, , float , , 5 :
5.0000 + 0.00001
-> 5.00001
-> 5.0000 (truncation to 5 digits)
5.0000 + 0.00001 + ... + 0.00001 (10 times)
-> 5.0000 + 0.00001 + ... + 0.00001 (9 times)
-> 5.0000 + 0.00001 + ... + 0.00001 (8 times)
-> ...
-> 5.0000
... ? , , ( ) .
, , , . , gcc, -freciprocal-math ( ). , , , , ().
, - ; , . , .