-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
58 lines (38 loc) · 1.25 KB
/
main.cpp
File metadata and controls
58 lines (38 loc) · 1.25 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "QuBLAS.h"
#include <algorithm>
#include <bitset>
#include <iostream>
#include <sys/types.h>
using namespace QuBLAS;
int main()
{
// constexpr int input_in = 0;
// constexpr int input_fr = 1;
// constexpr int output_in = 0;
// constexpr int output_fr = 1;
// using input_t = Qu<intBits<input_in>, fracBits<input_fr>,isSigned<false>>;
// using output_t = Qu<intBits<output_in>, fracBits<output_fr>,isSigned<false>>;
// input_t input;
// output_t out;
// std::ofstream myfile;
// myfile.open("sin.txt");
// for (int i = 0; i < (1<<(input_in+input_fr)); i++)
// {
// double input_double = input.toDouble();
// double output_double = std::atan(input_double);
// out = output_double;
// myfile << input.toString() << ' ' << out.toString() << std::endl;
// input.data.data++;
// }
// myfile.close();
// return 0;
using type1 = Qu<intBits<-5>, fracBits<9>, isSigned<true>, QuMode<TRN::SMGN>, OfMode<WRP::TCPL>>;
using type2 = Qu<intBits<2>, fracBits<2>, isSigned<true>, QuMode<TRN::SMGN>, OfMode<WRP::TCPL>>;
type1 a;
a.data.data = 15;
type2 b;
// b.data.data = -512;
a.display();
b=a;
b.display();
}