-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
29 lines (26 loc) · 1.01 KB
/
test.cpp
File metadata and controls
29 lines (26 loc) · 1.01 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
#include <iostream>
#include <bitset>
#include <tuple>
#include <random>
#include "shift.hpp"
int
main(){
std::default_random_engine e1(0);
std::uniform_int_distribution<std::int8_t> int_dist(-128,127);
std::uniform_int_distribution<std::uint8_t> uInt_dist(0,255);
for(int i = 0; i < 100; ++i){
std::uint8_t a_l = uInt_dist(e1);
std::int8_t a_h = int_dist(e1);
std::cout << " " << static_cast<std::bitset<8> >(a_h) << static_cast<std::bitset<8> > (a_l) << std::endl;
const auto [a_h_new,a_l_new] = shift2(a_h,a_l,4);
std::cout << static_cast<std::bitset<8> >(a_h_new)
<< static_cast<std::bitset<8> >(a_l_new) << std::endl <<std::endl;
// auto myTuple = split(a_h,a_l,7);
//
// std::cout << static_cast<std::bitset<8> >(std::get<0>(myTuple) ) << std::endl;
// std::cout << " " << static_cast<std::bitset<8> >(std::get<1>(myTuple)) << std::endl;
// std::cout << " " << static_cast<std::bitset<8> >(std::get<2>(myTuple) ) << std::endl;
//
}
return 0;
}