contributed by < EdwardCKC >
測驗 1
題目: 針對給定無號 64 位元數值 x 找出最接近且大於等於 2 的冪的值,例如:
next_pow2(6) = 8
next_pow2(15) = 16
next_pow2(64) = 64
x |= x >> 1 因為 >> precedence 比 | 高,所以執行順序是 x = x | (x >> 1)
Are you sure to leave this team?
Once you delete your team, all team notes will be deleted and cannot be recovered. Please ensure you've exported or transfered these notes.
Enter team name before deleting it:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up