using System; using System.Runtime.InteropServices;/* Provides mappings between C# and native code */ namespace NumericalAlgorithmsGroup { class tanfunc { [DllImport("FLDLL214Z_nag.dll")]/* Import from DLL, the C# compiler provides a rudimentry check of the signature */ public static extern double S07AAF(ref double x, ref int ifail); public static void Main() { double tanresult; int ifail = 1; double x = Math.PI/4; tanresult = S07AAF(ref x, ref ifail); Console.WriteLine("tan pi/4 = {0, 4:f2}", tanresult); } } }