1 /** @file numeric_output.cpp
3 * Test output of numeric types.
5 * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <ginac/ginac.h>
24 unsigned numeric_output(void)
28 cout << "checking output of numeric types..." << flush;
29 clog << "---------output of numeric types:" << endl;
31 unsigned long Digits_before = Digits;
33 clog << "Using " << Digits << " digits" << endl;
34 clog << Pi << " evalfs to: " << Pi.evalf() << endl;
35 clog << Catalan << " evalfs to: " << Catalan.evalf() << endl;
36 clog << EulerGamma << " evalfs to: " << EulerGamma.evalf() << endl;
37 clog << "Complex integers: ";
38 clog << "{(0,0)=" << ex(0 + 0*I) << "} ";
39 clog << "{(1,0)=" << ex(1 + 0*I) << "} ";
40 clog << "{(1,1)=" << ex(1 + 1*I) << "} ";
41 clog << "{(0,1)=" << ex(0 + 1*I) << "} ";
42 clog << "{(-1,1)=" << ex(-1 + 1*I) << "} ";
43 clog << "{(-1,0)=" << ex(-1 + 0*I) << "} ";
44 clog << "{(-1,-1)=" << ex(-1 - 1*I) << "} ";
45 clog << "{(0,-1)=" << ex(0 - 1*I) << "} ";
46 clog << "{(1,-1)=" << ex(1 - 1*I) << "} " << endl;
47 Digits = Digits_before;