Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 2.34 KB

File metadata and controls

55 lines (39 loc) · 2.34 KB
description Learn more about: feholdexcept
title feholdexcept
ms.date 04/05/2018
api_name
feholdexcept
api_location
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
api_type
DLLExport
topic_type
apiref
f1_keywords
feholdexcept
fenv/feholdexcept
helpviewer_keywords
feholdexcept function
ms.assetid 88e512ae-b5d8-452c-afe9-c824cd3ef1d8

feholdexcept

Saves the current floating-point environment in the specified object, clears the floating-point status flags, and, if possible, puts the floating-point environment into non-stop mode.

Syntax

int feholdexcept(
   fenv_t *penv
);

Parameters

penv
Pointer to an fenv_t object to contain a copy of the floating-point environment.

Return value

Returns zero if and only if the function is able to successfully turn on non-stop floating-point exception handling.

Remarks

The feholdexcept function is used to store the state of the current floating point environment in the fenv_t object pointed to by penv, and to set the environment to not interrupt execution on floating-point exceptions. This mode is known as non-stop mode. This mode continues until the environment is restored using fesetenv or feupdateenv.

You can use this function at the beginning of a subroutine that needs to hide one or more floating-point exceptions from the caller. To report an exception, you can clear the unwanted exceptions by using feclearexcept, and then end the non-stop mode with a call to feupdateenv.

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
feholdexcept <fenv.h> <cfenv>

For more compatibility information, see Compatibility.

See also

Alphabetical function reference
feclearexcept
fesetenv
feupdateenv