(*  constant_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate constants *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  21 January 2008 *)
(*  Author:  John Burkardt *)

Print [  "  1/Pi   = ", N[1/Pi,20] ];
Print [  "    Pi/4 = ", N[Pi/4,20] ];
Print [  "    Pi/2 = ", N[Pi/2,20] ];
 Print[ "     Pi  = ", N[Pi,20] ];
Print [ "   2*Pi  = ", N[2*Pi, 20 ] ]; 
Print [ "Sqrt[Pi] = ", N[Sqrt[Pi], 20 ] ];
Print [ "Sqrt[2]  = ", N[Sqrt[2], 20 ]];
Print [ "Sqrt[3]  = ", N[Sqrt[3], 20 ]];
Print [ "Sqrt[5]  = ", N[Sqrt[5], 20 ]];
Print [ "Cos[Pi/6]= ", N[Cos[Pi/6], 20]];
Print [ "Cos[Pi/4]= ", N[Cos[Pi/4], 20]];
Print [ "     E   = ", N[E, 20]];
Print [ "(1+Sqrt[5])/2 = ", N[(1+Sqrt[5])/2,20]];
Print [ "EulerGamma = ", N[EulerGamma,20]];

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/constant_values.txt"];SetOptions[fileout,FormatType->TextForm];Write[fileout,"#  constant_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"   1/Pi   = ", N[1/Pi,20] ];
Write[fileout,"     Pi/4 = ", N[Pi/4,20] ];
 Write[fileout,"     Pi/2 = ", N[Pi/2,20] ];
 Write[fileout,"     Pi   = ", N[Pi,20] ];
Write[fileout, "   2*Pi   = ", N[2*Pi, 20 ] ]; 
Write[fileout, "Sqrt[Pi]  = ", N[Sqrt[Pi], 20 ] ];
Write[fileout, "Sqrt[2]   = ", N[Sqrt[2], 20 ]];
Write[fileout, "Sqrt[3]   = ", N[Sqrt[3], 20 ]];
Write[fileout, "Sqrt[5]   = ", N[Sqrt[5], 20 ]];
Write[fileout, "Cos[Pi/6] = ", N[Cos[Pi/6],20]];
Write[fileout, "Cos[Pi/4] = ", N[Cos[Pi/4],20]];
Write[fileout, "    E     = ", N[E,20]];
Write[fileout, "(1+Sqrt[5])/2 = ", N[(1+Sqrt[5])/2,20]];
Write[fileout, "EulerGamma = ",N[EulerGamma, 20]];
Close[fileout];