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