Advertisement
chatchai_j

Untitled

Jul 28th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4.  
  5. #define PAGE_SIZE sizeof(uint64_t) * 8
  6. #define PAGE_SIZE2 (sizeof(uint64_t) * 8)
  7.  
  8. int main(void) {
  9.     uint16_t slot_id = 6005;
  10.     uint16_t page = slot_id/PAGE_SIZE;
  11.     uint16_t page2 = slot_id/PAGE_SIZE2;
  12.  
  13.     printf("PAGE_SIZE = %d\n", PAGE_SIZE);
  14.     printf("slot_id = %d\n", slot_id);
  15.     printf("page = %d\n", page);
  16.     printf("page2 = %d\n", page2);
  17.  
  18.     printf("value = %d\n", 6005/8*8);
  19.     printf("value2 = %d\n", 6005/(8*8));
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement