]> www.ginac.de Git - ginac.git/blob - check/numeric_output.cpp
f010ab79dc4b5e558757577a80ff70e8100fc84c
[ginac.git] / check / numeric_output.cpp
1 // check/numeric_output.cpp
2
3 #include "ginac.h"
4
5 unsigned numeric_output(void)
6 {
7     unsigned result = 0;
8     
9     cout << "checking output of numeric types..." << flush;
10     clog << "---------output of numeric types:" << endl;
11     
12     unsigned long Digits_before = Digits;
13     Digits = 200;
14     clog << "Using " << Digits << " digits" << endl;
15     clog << Pi << " evalfs to: " << Pi.evalf() << endl;
16     clog << Catalan << " evalfs to: " << Catalan.evalf() << endl;
17     clog << EulerGamma << " evalfs to: " << EulerGamma.evalf() << endl;
18     clog << "Complex integers: ";
19     clog << "{(0,0)=" << ex(0 + 0*I) << "} ";
20     clog << "{(1,0)=" << ex(1 + 0*I) << "} ";
21     clog << "{(1,1)=" << ex(1 + 1*I) << "} ";
22     clog << "{(0,1)=" << ex(0 + 1*I) << "} ";
23     clog << "{(-1,1)=" << ex(-1 + 1*I) << "} ";
24     clog << "{(-1,0)=" << ex(-1 + 0*I) << "} ";
25     clog << "{(-1,-1)=" << ex(-1 - 1*I) << "} ";
26     clog << "{(0,-1)=" << ex(0 - 1*I) << "} ";
27     clog << "{(1,-1)=" << ex(1 - 1*I) << "} " << endl;
28     Digits = Digits_before;
29     
30     if (! result) {
31         cout << " passed ";
32     } else {
33         cout << " failed ";
34     }
35     
36     return result;
37 }