1

My problem is as follows:

I need to know the current floating-point rounding mode for c/c++ programs in present vs2012 /2010/2008 developing environment . Set the rounding mode (_RC_NEAR,_RC_DOWN,...) by calling _set_controlfp(_RC_DOWN,_MCW_RC), and default is _RC_NEAR. However, I want to get the value;

I try to call _statusfp() get the return value, but in which rounding mode did not store , the return value is always 0 unless an inaccuracy arithmetic(such as , overflow etc.) and is not dependent on rounding mode. After reading float.h supplied by vs2012/2008, I also cannot find any tips.

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
  • Q: Does this link help: https://msdn.microsoft.com/en-us/library/9st43tcf.aspx? – FoggyDay Jan 23 '15 at 14:45
  • 1
    Probably this helps, there is an example on C http://stackoverflow.com/questions/6867693/change-floating-point-rounding-mode – Dumanskiy Jan 23 '15 at 14:45
  • @Dumanskiy . It is ok ! . by calling _controlfp(0,0) , I know this function, but did not known the arguments. Thanks. – user2940648 Jan 23 '15 at 14:58

0 Answers0