lundi 15 avril 2019

Why RAND_MAX differs on the same machine in linux from windows?

I was trying to generate some random numbers using rand() but I checked RAND_MAX first as I want to make some large numbers. In Windows 10 printf("%x",RAND_MAX); gives 0x7fff while on linux 18.04 printf("%x",RAND_MAX); gives 0x7ffffff Why the maximum range changes while I am using the same compiler GCC with same libraries on the same machine ? Is there is a way that I configure my IDE (code blocks) or compiler on Windows to get the same size as it on linux?




Aucun commentaire:

Enregistrer un commentaire