We have a DLL compiled under Borland C++ Builder 5 calling an exported C entry point in a Mixed Mode Managed C++ DLL. This function in turn calls functions in a C# assembly. The application executable is also compiled by Borland. We encountered an ArithmeticException thrown from the System.Drawing.Font constructor, and using a disassembler, found it to be on the line: if (((emSize == float.NaN) || (emSize == float.NegativeInfinity)) || (((emSize == float.PositiveInfinity) || (emSize <= 0f)) || (emSize > float.MaxValue))) in the function private void Initialize(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte gdiCharSet, bool gdiVerticalFont) So, we pulled out the line into our own C# code, where it still throws an exception, and narrowed it down to the portion: (emSize == float.NaN) This expression throws an ArithmeticException exception with the message "Overflow or underflow in the arithmetic operation." The rest of the comparisons work correctly, and assigning float.NaN to a variable also works, but then trying to compare that variable to another throws the exception. However, if I change the statement to float.IsNaN(emSize), it doesn't throw an exception. The docs for float.NaN say: "Use IsNaN to determine whether a value is not a number. It is not possible to determine whether a value is not a number by comparing it to another value equal to NaN." So, is Microsoft violating their own rules here? Also, if I try a literal comparison, e.g. (15 == float.NaN), this does not throw. So, what could be going wrong? When the code is called from an unmanaged DLL compiled with Microsoft's compiler, we don't have this problem. So it seems that Borland is doing something differently that causes this problem. Any ideas what this could be, or any way we can get around it? thanks