Skip to content

Commit c423598

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents ee7d808 + 65b38a5 commit c423598

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

docs/c-runtime-library/reference/fegetround-fesetround2.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["fegetround", "fesetround", "fenv/fegetround", "fenv/fesetround"]
1010
helpviewer_keywords: ["fegetround function", "fesetround function"]
11-
ms.assetid: 596af00b-be2f-4f57-b2f5-460485f9ff0b
1211
---
1312
# `fegetround`, `fesetround`
1413

@@ -18,10 +17,7 @@ Gets or sets the current floating-point rounding mode.
1817

1918
```C
2019
int fegetround(void);
21-
22-
int fesetround(
23-
int round_mode
24-
);
20+
int fesetround(int round_mode);
2521
```
2622
2723
### Parameters
@@ -51,30 +47,29 @@ The default behavior of `FE_TONEAREST` is to round results midway between repres
5147
The current rounding mode affects these operations:
5248
5349
- String conversions.
54-
5550
- The results of floating-point arithmetic operators outside of constant expressions.
56-
5751
- The library rounding functions, such as `rint` and `nearbyint`.
58-
5952
- Return values from standard library mathematical functions.
6053
6154
The current rounding mode doesn't affect these operations:
6255
6356
- The `trunc`, `ceil`, `floor`, and `lround` library functions.
64-
6557
- Floating-point to integer implicit casts and conversions, which always round towards zero.
66-
6758
- The results of floating-point arithmetic operators in constant expressions, which always round to the nearest value.
6859
6960
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).
7061
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.
65+
7166
## Requirements
7267
7368
| Function | C header | C++ header |
7469
|---|---|---|
75-
| **`fegetround`**, **`fesetround`** | \<fenv.h> | \<cfenv> |
70+
| **`fegetround`**, **`fesetround`** | `<fenv.h>` | `<cfenv>` |
7671
77-
For more compatibility information, see [Compatibility](../compatibility.md).
72+
For more information, see [Compatibility](../compatibility.md).
7873
7974
## See also
8075

0 commit comments

Comments
 (0)