-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathu-powi.cc
31 lines (23 loc) · 875 Bytes
/
u-powi.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//#include <limits>
#include <lvv/lvv.h>
#include <lvv/math.h>
#include <lvv/check.h>
using namespace std;
using namespace lvv;
///////////////////////////////////////////////////////////////////
int
main() {
setup_fpe();
cerr << setprecision(numeric_limits<double>::digits10+4) << boolalpha;
cout << setprecision(numeric_limits<double>::digits10+4) << boolalpha;
cout << "\n\n *** Test POWI() ***\n";
cout << std::boolalpha;
CHECK(eq(powi(3.33, 0), 1. ));
CHECK(eq(powi(3.33, 1), 3.33 ));
CHECK(eq(powi(3.33, 2), 11.0889 ));
CHECK(eq(powi(3.33, 3), 36.926037 ));
CHECK(eq(powi(3.33, 4), 122.96370321));
CHECK(eq(powi(0. , 4), 0. ));
cout << (all_pass ? "\n------------ all pass ------------\n" : "\n!!!!!!!!! SOME FAILED !!!!!!!!\n");
exit(all_pass ? 0 : 1);
}