---
name: "PGARandom01"
section: "3"
platform: "linux"
package: "pgapack"
version: "1.0.0.1-3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/PGARandom01"
---

# PGARandom01(3)

generates a uniform random number on the interval \[0,1) If the second argument is 0 it returns the next random number in the sequence. Otherwise, the second argument is used as a new seed for the population

## NAME

PGARandom01 - generates a uniform random number on the interval \[0,1) If the second argument is 0 it returns the next random number in the sequence.  Otherwise, the second argument is used as a new seed for the population

## INPUT PARAMETERS

- ctx

  \- context variable

- newseed

  \- either 0 to get the next random number, or nonzero to reseed Outputs: A random number on the interval \[0,1)

## OUTPUT PARAMETERS

- none

  ## SYNOPSIS

```
#include "pgapack.h"
double  PGARandom01(ctx, newseed)
PGAContext *ctx
int newseed
```

## LOCATION

random.c

## EXAMPLE

```
PGAContext *ctx;
double r;
:
r = PGARandom01(ctx,0);
```
