ftp.nice.ch/pub/next/games/strategic/rulerule.NIHS.bs.tar.gz#/rulerule/random.c

This is random.c in view mode; [Download] [Up]

#include "random.h"
#include "math.h"
#include <limits.h>

double randomVal(double from, double to)
{
  double hlp, f = from, t = to;
    
  if (t < f)
  {
    hlp = f;
    f = t;
    t = hlp;
  }
  
  if (t == f)
  {
    return t;
  }

  return (f + (t - f)*((double)random() / (double)(ULONG_MAX/2)));
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.