You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -18,10 +17,7 @@ Gets or sets the current floating-point rounding mode.
18
17
19
18
```C
20
19
intfegetround(void);
21
-
22
-
int fesetround(
23
-
int round_mode
24
-
);
20
+
int fesetround(int round_mode);
25
21
```
26
22
27
23
### Parameters
@@ -51,30 +47,29 @@ The default behavior of `FE_TONEAREST` is to round results midway between repres
51
47
The current rounding mode affects these operations:
52
48
53
49
- String conversions.
54
-
55
50
- The results of floating-point arithmetic operators outside of constant expressions.
56
-
57
51
- The library rounding functions, such as `rint` and `nearbyint`.
58
-
59
52
- Return values from standard library mathematical functions.
60
53
61
54
The current rounding mode doesn't affect these operations:
62
55
63
56
- The `trunc`, `ceil`, `floor`, and `lround` library functions.
64
-
65
57
- Floating-point to integer implicit casts and conversions, which always round towards zero.
66
-
67
58
- The results of floating-point arithmetic operators in constant expressions, which always round to the nearest value.
68
59
69
60
To use these functions, you must turn off floating-point optimizations that could prevent access by using the `#pragma fenv_access(on)` directive prior to the call. For more information, see [`fenv_access`](../../preprocessor/fenv-access.md).
70
61
62
+
> [!IMPORTANT]
63
+
> Prior to Windows 10 version 14393, `fenv.h` defined `FE_UPWARD = 0x0100` and `FE_DOWNWARD = 0x0200`. In Windows version 14393, this header was updated to address a bug in which some APIs would interpret `FE_UPWARD` as `FE_DOWNWARD`, and vice-versa. Starting in Windows version 14393, `FE_UPWARD = 0x0200` and `FE_DOWNWARD = 0x0100`, reversing their previous values.
64
+
> If you compiled your app against an old Windows SDK version (this issue depends on SDK version, not OS version or VS version) you might encounter this issue. Update your app to target the latest Windows SDK so that the definitions of `FE_UPWARD` and `FE_DOWNWARD` are consistent with the Windows implementation. If you can't update your app to target a later Windows SDK, you can define `FE_UPWARD` as `0x0100` and `FE_DOWNWARD` as `0x0200` in your code.
0 commit comments