samedi 1 août 2020

How is #define S64_MIN defined in linux data types?

I am trying to understand the definition of a linux macro S64_MIN used in the following else condition i.e. draw = S64_MIN.

Which exact decimal value is meant here for S64_MIN?

        if (weights[i]) 
          {
            u = hash(bucket->h.hash, x, ids[i], r);
            u &= 0xffff;
            ln = crush_ln(u) - 0x1000000000000ll;
            
            __s64 draw = div64_s64(ln, weights[i]);
        } 
else   
       {
            __s64 draw = S64_MIN;  
           
          // #define S64_MAX    ((s64)(U64_MAX >> 1))
          // #define S64_MIN    ((s64)(-S64_MAX -1))
       }
        if (i == 0 || draw > high_draw) 
            
          {
            high = i;
            high_draw = draw;
          }
    }
    return bucket->h.items[high];
}

Aucun commentaire:

Enregistrer un commentaire