Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstring>
- #include <cassert>
- #define EPS 1e-9
- inline int rdn(double x) {
- int y = (int)x + 5;
- while ((double)y > x + EPS) y--;
- return y;
- }
- int main() {
- for (int h = 8388608; h <= 16777216; h <<= 1) {
- double _rw = (double)h / 0.8;
- double _rw_bad = (double)(1 << 24) / 0.8;
- if (!memcmp(&_rw, &_rw_bad, sizeof(double))) {
- printf("%d == %d\n", rdn(_rw), rdn(_rw_bad));
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement