diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-30 18:48:58 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2015-07-30 18:48:58 +0200 |
| commit | 1c2dcd1125d4a542a7b4b291e8de1f3b3cdc86a0 (patch) | |
| tree | 69f2ecfefa8630655cd09433973730a0a75f0a83 /SyncRNG.R | |
| parent | fix typos in README (diff) | |
| download | SyncRNG-1c2dcd1125d4a542a7b4b291e8de1f3b3cdc86a0.tar.gz SyncRNG-1c2dcd1125d4a542a7b4b291e8de1f3b3cdc86a0.zip | |
By passing numbers between R and C as doubles we can avoid the limitations of the R integer type. This allows us to create a uniform RNG.
Diffstat (limited to 'SyncRNG.R')
| -rw-r--r-- | SyncRNG.R | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -11,13 +11,13 @@ SyncRNG <- setRefClass('SyncRNG', initialize=function(..., seed=0) { seed <<- seed tmp <- .Call('R_syncrng_seed', - as.integer(seed)) + as.numeric(seed)) state <<- tmp[1:4] callSuper(...) }, randi=function() { tmp <- .Call('R_syncrng_rand', - as.integer(state)) + as.numeric(state)) state <<- tmp[1:4] return(tmp[5]) }, |
