Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 2.67 KB

fesetenv1.md

File metadata and controls

60 lines (49 loc) · 2.67 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic apiname apilocation apitype f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
fesetenv | Microsoft Docs
11/04/2016
cpp
devlang-cpp
article
fesetenv
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-runtime-l1-1-0.dll
DLLExport
fesetenv
fenv/fesetenv
C++
fesetenv function
ffc64fff-8ea7-4d59-9e04-ff96ef8cd012
6
corob-msft
corob
ghogen

fesetenv

Sets the current floating-point environment.

Syntax

int fesetenv(  
   const fenv_t *penv  
);  

Parameters

penv
Pointer to a fenv_t object that contains a floating-point environment as set by a call to fegetenv or feholdexcept. You can also specify the default startup floating-point environment by using the FE_DFL_ENV macro.

Return Value

Returns 0 if the environment was successfully set. Otherwise, returns a nonzero value.

Remarks

The fesetenv function sets the current floating-point environment from the value stored in the fenv_t object pointed to by penv. The floating point environment is the set of status flags and control modes that affect floating-point calculations. This includes the rounding mode and the status flags for floating-point exceptions. If penv is not FE_DFL_ENV or does not point to a valid fenv_t object, subsequent behavior is undefined.

A call to this function sets the exception status flags that are in the penv object, but it does not raise those exceptions.

To use this function, 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.

Requirements

Function C header C++ header
fesetenv <fenv.h> <cfenv>

For additional compatibility information, see Compatibility.

See Also

Alphabetical Function Reference
fegetenv
feclearexcept
feholdexcept
fesetexceptflag