Let me have two floating point variables coming as function arguments:
float fun(float x, float y) {
// ...
}
I would like to calculate the floor of their sum. Is it possible to do it correctly not relating on current floating point rounding mode?
I mean the following. Consider the expression:
floorf(x+y)
It is possible that the exact value of the function argument (x + y) < n for some integer n will be rounded to the nearest integer n during the floating point operation, and then the floorf() function will return n instead of (n-1).