// s21bc Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; namespace NagDotNetExamples { public class S21BCE { static void Main(String[] args) { StartExample(); } public static void StartExample() { try { PrintManager.Warning = new PrintManager.MessageLogger(discardmessage); double rd, x, y, z; int ix, iy; int ifail; Console.WriteLine("s21bc Example Program Results"); Console.WriteLine(""); Console.WriteLine(" {0}", " x y z s21bc ifail"); Console.WriteLine(""); for (ix = 1; ix <= 3; ix++) { x = ix * 0.50e0; for (iy = ix; iy <= 3; iy++) { y = iy * 0.50e0; z = 1.00e0; // rd = S.s21bc(x, y, z, out ifail); // if (ifail >= 0) { Console.WriteLine(" {0,7:f2}{1,7:f2}{2,7:f2}{3,12:f4}{4,5}", x, y, z, rd, ifail); } else { Console.WriteLine("** s21bc failed with ifail = {0,5}", ifail); } } } } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Exception Raised"); } } static void discardmessage(String message) { } } }