Advertisement
Guest User

Untitled

a guest
Jul 10th, 2016
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1.  
  2. int guess_max(double x, int N, int count)
  3. {
  4.     static double my_max=-1;
  5.     if(count<N)
  6.     {
  7.         if(x>my_max)my_max=x;
  8.         return 0;
  9.     }
  10.     char* start=(char*)&x;
  11.     while(1)
  12.     {
  13.         start+=1;
  14.         double* db=(double*) start;
  15.         if(*db==my_max)break;
  16.  
  17.     }
  18.     int i=0;
  19.     for(;i<64;i++) // hmm?
  20.     {
  21.         double* db=(double*) start;
  22.         if(*db==my_max)
  23.             *db=x;
  24.         start+=4;
  25.     }
  26.     return 1;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement