I am trying to port an old project from Visual Studio 2010 to Visual Studio 2015. The problem is that snprintf (used with format "%.15g") rounds doubles differently than it used to do with Visual Studio 2010.
There are two problems:
The e-notation changed from e.g. 12345e005 to 12345e05
Doubles like 105.52361792790150 are now converted to "105.523617927901" instead of "105.523617927902".
I found the reason for the "missing" zero digit:
Microsoft changed it intentionally to be more standard compliant: https://blogs.msdn.microsoft.com/vcblog/2014/06/18/c-runtime-crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1/ (see "Exponent Formatting")
I implemented a solution to add the missing zero digit, but I can't find a solution for the different rounding behavior.
Is there any way to change the rounding behavior to the "old style"? I tried std::fesetround but it seems to have no effect on snprintf rounding.