On this code : http://prng.di.unimi.it/xoshiro256plus.c They do this :
static const uint64_t JUMP[] = { 0x180ec6d33cfd0aba, 0xd5a61266f0c9392c, 0xa9582618e03fc9aa, 0x39abdc4529b1661c };
for(int i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
What does sizeof JUMP / sizeof *JUMP means and how to port it to c# ?
sizeof JUMP seems to be Marshal.Sizeof(JUMP) according to https://docs.microsoft.com/fr-fr/dotnet/api/system.runtime.interopservices.marshal.sizeof?view=netframework-4.8
But Marshal.Sizeof(*JUMP) cant be donne in safe mode and I cant use unsafe code.
And according to this page : https://en.cppreference.com/w/cpp/language/sizeof sizeof JUMP / sizeof *JUMP return array's length. So why not just put 4 instead as JUMP length is known ?
Thank.
Aucun commentaire:
Enregistrer un commentaire