| 1 | /** |
| 2 | * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | * This file is part of the mingw-w64 runtime package. |
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | */ |
| 6 | |
| 7 | #include <fenv.h> |
| 8 | #include <internal.h> |
| 9 | |
| 10 | /* 7.6.3.2 |
| 11 | The fesetround function establishes the rounding direction |
| 12 | represented by its argument round. If the argument is not equal |
| 13 | to the value of a rounding direction macro, the rounding direction |
| 14 | is not changed. */ |
| 15 | |
| 16 | int fesetround(int round_mode) |
| 17 | { |
| 18 | if (round_mode & (~_MCW_RC)) |
| 19 | return 1; |
| 20 | __mingw_controlfp(round_mode, _MCW_RC); |
| 21 | return 0; |
| 22 | } |