View Single Post
  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
Lynn McGuire[_2_] Lynn McGuire[_2_] is offline
external usenet poster
 
Posts: 47
Default Excel is messing with the math coprocessor

On 3/15/2012 11:34 AM, joeu2004 wrote:
"Lynn McGuire" wrote:
I have just noticed that Excel is changing the floating
point round off handling in the math coprocessor for my
C++ and Fortran DLL. Has anyone run into this ?


I do not use C++ or Fortran, but what you describe does not surprise me, speaking as a computer and software architect.

The floating-point unit is a global resource. I would not expect any application to save and restore the FPU's previous state before
making application-specific changes.

Instead, I would expect each application to set the FPU state as it requires before using it.

So the fault is not Excel's.

Instead, I would expect C++ and Fortran to configure the FPU as each language requires it, especially the floating-point rounding
option.

Alternatively, perhaps your application should configure the FPU as you require it.


It looks like that I need to save the current state
of the FPU, reconfigure the FPU and set the FPU back
to the saved state at each entry point in my DLL.

Lynn