pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2139:    *!    *! This function returns a random number in the range    *! @expr{0 .. @[max]-ɛ@}.    *!    *! @seealso    *! @[Random]    */    PIKEFUN float random(float f)    {    if(f<=0.0) RETURN 0.0; -  INT64 value; - #if SIZEOF_INT_TYPE > 4 -  value = read_int(0xffffffffffffffff); - #else -  value = read_int(0xffffffff) << 32 | read_int(0xffffffff); - #endif +  unsigned INT64 value; +  if (THIS->buffer_bits < 64) +  fill_int_buffer(); +  value = THIS->int_buffer; +  THIS->buffer_bits = 0; +     RETURN (FLOAT_TYPE)ldexp((double)f * value, -64);    }       /*! @decl mixed random(array|multiset x)    *! Returns a random element from @[x].    */       PIKEFUN mixed random(array a)    rawtype tFunc(tArr(tSetvar(0,tMix)),tVar(0));    {