Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ld x = 30.619, y = -0.002, z = 128 + x*y;
- cout << z << endl;
- z = abs(z);
- for (int i = (1 << 16); i >= 1; i >>= 1) {
- if (z >= i)
- cout << 1,
- z -= i;
- else
- cout << 0;
- }
- cout << '.';
- while (z) {
- z *= 2;
- cout << int(z);
- z -= int(z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement