Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<char> &int128_str(int128_t x) {
- vector<char> s;
- int tail = 0;
- int count = 0;
- bool read = true;
- __int128_t temp
- __int128_t test = 1;
- if (x < ((__int128_t)0))
- s.push_back('-'), x = - x;
- if (x == ((__int128_t)0)) {
- s.push_back('0');
- return s;
- }
- while((test <= x) && (read)) {
- test = test + test; if (test < ((s128_o) 0)) { read = false; } t = test;
- test = test + test; if (test < ((s128_o) 0)) { read = false; }
- test = test + test; if (test < ((s128_o) 0)) { read = false; }
- test = test + t; if (test < ((s128_o) 0)) { read = false; }
- count ++;
- }
- while(count-- > 0) {
- test = tail = 1;
- for(int i = 0; i < count; i++) {
- test = test + test; t = test;
- test = test + test;
- test = test + test;
- test = test + t;
- }
- while(x >= test)
- x = x - test, tail++;
- s.push_back('0' + tail);
- }
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement