Eric Fleegal's WebLog

. . . .

FP Whitepaper Errata: The float_control Pragma in VC8.0

The /fp:precise, /fp:fast, /fp:strict and /fp:except switches control floating-point semantics on a file-by-file basis. The float_control pragma combined with the fenv_access and fp_contract pragmas allow such control on a function-by-function basis.

 

Usage:

 

#pragma float_control(push)

#pragma float_control(pop)

 

#pragma float_control( precise, on | off [, push] )

#pragma float_control( except, on | off [, push] )

 

 

The pragmas float_control(push) and float_control(pop) respectively push and pop the current state of the floating-point mode and the exception option onto a stack.  Note that the state of the fenv_access and fp_contract pragma are not affected by pragma float_control(push/pop). 

 

Calling the pragma float_control(precise, on | off) will enable or disable precise-mode semantics.  Similarly, the pragma float_control(except, on | off) will enable or disable exception semantics.  Exception semantics can only be enabled when precise semantics are enabled.  When the optional push argument is present, the states of the float_control options are pushed prior to changing semantics.

Published Tuesday, May 18, 2004 5:33 PM by ericflee

Comments

No Comments
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker