#include "matlib.h"

#include <strstream.h>
#include <owl\owlpch.h>
#include <owl\applicat.h>

/*

  Example program showing how to use the MATCOM LIBRARY in an OWL program.
  The library is streamed from the stin istrstream to the stout and
  sterr ostrstreams. Than, stout is displayed in the Window title.

  Standard libraries must be linked statically.

 (c) Copyright Yaron Keren 1995-6

*/

int OwlMain(int, char**)
{
  ostrstream stout, sterr;
  char empty[]="\0";
  istrstream stin(empty);
  initM(stin,stout,sterr);

  M x(0,0,"x");
  x=sqrt(2);
  fprintfM("sqrt(2) = %.12g",x);

  stout<<'\0';
  TApplication(stout.str()).Run();

  exitM();
  return 0;
}

