lua-users home
lua-l archive

Re: [ANN] Lua 5.4.0 (work1) now available

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I might have optimize project() too much, a simple version would do nicely.

static lua_Unsigned project(lua_Unsigned ran, lua_Unsigned n, RanState *state)
{
int bits = __builtin_clzll(n);
while ((ran >>= bits) > n) ran = I2UInt( xorshift128plus(state->s) );
return ran;
}


AltStyle によって変換されたページ (->オリジナル) /