Displaying 2 results from an estimated 2 matches for "oldrm".
Did you mean:
oldmm
2017 Nov 04
2
FW: clarification needed for the constrained fp implementation.
...n” state. A
> typical usage might look like this:
>
> #include <fenv.h>
>
> double someFunc(double A, double B, bool ForceRoundUp) {
>
> #pragma STDC FENV_ACCESS ON
>
> double Result;
>
> if (ForceRoundUp) {
>
> int OldRM = fegetround();
>
> fesetround(FE_UPWARD);
>
> Result = A/B;
>
> fesetround(OldRM);
>
> } else {
>
> Result = A/B;
>
> }
>
> return Result;
>
> }
>
>
> ...
> abridge
> ...
>
>...
2017 Nov 03
2
FW: clarification needed for the constrained fp implementation.
...pt, etc.) but you can only safely use these if you have set FENV_ACCESS to the "on" state. A typical usage might look like this:
#include <fenv.h>
double someFunc(double A, double B, bool ForceRoundUp) {
#pragma STDC FENV_ACCESS ON
double Result;
if (ForceRoundUp) {
int OldRM = fegetround();
fesetround(FE_UPWARD);
Result = A/B;
fesetround(OldRM);
} else {
Result = A/B;
}
return Result;
}
So you see here that there are explicit calls to change the rounding mode. If you were to do this in clang today, the generated IR would look like this:
define...