---
title: nextUniform()
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: gameplaykit/gkrandom/nextuniform()
---

# nextUniform()

Generates and returns a new random floating-point value.

## Declaration

```swift
func nextUniform() -> Float
```

## Return Value

Return Value A random floating-point value in the range [0.0, 1.0].

## Discussion

Discussion The distribution of multiple samplings is uniform within the range [0.0, 1.0]; that is, the probability of this method returning any one value is approximately equal to that of returning any other value. Typically, custom classes implementing this protocol should implement the nextUniform() method based on the value returned by the nextInt(upperBound:) method. Alternative implementations are possible, but may lead to less uniform results.

## See Also

### Generating Random Numbers

- [nextInt()](gameplaykit/gkrandom/nextint().md)
- [nextInt(upperBound:)](gameplaykit/gkrandom/nextint(upperbound:).md)
- [nextBool()](gameplaykit/gkrandom/nextbool().md)
