about summary refs log tree commit diff
path: root/generator
diff options
context:
space:
mode:
Diffstat (limited to 'generator')
-rw-r--r--generator/pamcrater.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/generator/pamcrater.c b/generator/pamcrater.c
index b8ceafa5..8f0e422d 100644
--- a/generator/pamcrater.c
+++ b/generator/pamcrater.c
@@ -163,7 +163,6 @@ parseCommandLine(int argc, const char ** const argv,
 
 
 
-static double const arand       = 32767.0;  /* Random number parameters */
 static double const CdepthPower = 1.5;      /* Crater depth power factor */
 static double const DepthBias2  = 0.5;      /* Square of depth bias */
 
@@ -175,7 +174,7 @@ cast(double             const high,
 /*----------------------------------------------------------------------------
    A random number in the range [0, 'high'].
 -----------------------------------------------------------------------------*/
-    return high * ((pm_rand(randStP) & 0x7FFF) / arand);
+  return high * ((double) pm_rand(randStP) / randStP->max);
 }
 
 
@@ -222,7 +221,6 @@ terrainModP(struct pam * const pamP,
 
 
 
-
 static sample
 terrainMod(struct pam * const pamP,
            tuple **     const terrain,
@@ -522,3 +520,4 @@ main(int argc, const char ** argv) {
 }
 
 
+