Differences between Math.Exp() (.NET function) and exp() standard function)

Microsoft Visual Studio .NET

troy
Hi,

I've used Math.Exp() in a C# project and exp() in an C++ 
unmanaged project in the same solution of Visual 
Studio .NET 2003. The results of a simple calculus in 
double precision are different :
Math.Exp(39.933030539427435) = 2.201378947939657e+017
exp(39.933030539427435)      = 2.2013789479396598e+017

Could someone tell me what is the difference between the 
two functions ? (algorithm ?)
                                            
Sylvain
The Pentium4 does its calculation on 80bits instead of 64bits.  For C++, you 
can tell the compiler to keep the full 80bits extension until the result is 
stored in memory or to round to 64bits for each calculation step.  (However, 
I don't know how to specify this for the VS C++.NET; as much of these 
parameters seems to be gone (but I don't miss them)).  Other compilers 
offers these possibilities.

The C# always uses the full 80bits extension for all calculation steps and 
will show a slightly higher pricision than C++.  If possible and if 
supported by the hardware, it will also use the « long double » type if it 
is available for doing its calculations.

S. L.