We have a customer that is calling our calculation engine from a VB6 application. They've shared a bug with us, that in our .Net test harness we've not been able to reproduce.
The exception occurs the second time they make a call to our calculation engine. New object are being created with each call. The arithmetic exception is thrown when in a line of code that uses Math.Sqrt() http://msdn.microsoft.com/en-us/library/system.math.sqrt(v=vs.110).aspx Math.Sqrt() returns a Nan because of a negative number, this seems related. The input values to our function are all Double type.
The exact exception is "Overflow or underflow in the arithmetic operation."
In researching this the closest thing I found was the following SO article... Perhaps something similar going on here? For now we've worked around the issue by using the complex number library to calculate the square root.
C# - cc3260mt.dll throws ArithmeticException whenever I load it
Any ideas?