Statistiques
| Révision :

root / Pi / RNG / MWC.c @ 20

Historique | Voir | Annoter | Télécharger (331 octet)

1
#include <stdio.h>
2
#include <math.h>
3

    
4
#define znew (z=36969*(z&65535)+(z>>16))
5
#define wnew (w=18000*(w&65535)+(w>>16))
6
#define MWC ((znew<<16)+wnew)
7
#define MWCfp (MWC + 1.0f) * 2.328306435454494e-10f
8

    
9
int main(void) {
10
  int i,z,w;
11

    
12
  z=37;
13
  w=91;
14

    
15
  for (i=1;i<100;i++) {
16

    
17
    printf("%i %i %i %i\n",i,znew,wnew,MWC);
18
  
19
  }
20

    
21
}