Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 1st, 2012  |  syntax: C  |  size: 0.30 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void find_best_factorization(int *bx, int *by, uint nblocks){
  2.         *bx = -1;
  3.         int bytmp;
  4.  
  5.         for(bytmp = 1; bytmp != 65536; bytmp++){
  6.                 if(nblocks / bytmp < 65535){
  7.                         *by = bytmp;
  8.                         *bx = nblocks / bytmp;
  9.  
  10.                         break;
  11.                 }
  12.         }
  13.  
  14.         if(*bx == -1){
  15.                 printf("Unfactorizable?!\n");
  16.                 exit(-1);
  17.         }
  18. }
clone this paste RAW Paste Data