Random(STR type) renvoie un élément aléatoire du type défini :
HaypoCALC utilise la fonction rand() de la librairie standard C stdlib.h, elle se base sur le calcul modulo.
#define RAND_MAX 0x7fffffff
long next;
int rand()
{
next *= 1103515245;
next += 12345;
return (next % ((unsigned long)RAND_MAX + 1));
}
#define RAND_MAX 0x7fff
long holdrand;
int rand(void)
{
holdrand *= 214013L;
holdrand += 2531011L;
return ((holdrand >> 16) & 0x7fff);
}
Par Victor STINNER (Haypo) - Validation XHTML 1.0 Strict, CSS