<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKRandomDistribution/nextUniform()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRandomDistribution(im)nextUniform"
  },
  "title" : "nextUniform()"
}
-->

# nextUniform()

Generates and returns a new random floating-point value within the characteristics of the distribution.

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

## Return Value

A random floating-point value within the range `[delta, 1.0]`, where `delta` is the ratio of the [`lowestValue`](/documentation/GameplayKit/GKRandomDistribution/lowestValue) and [`highestValue`](/documentation/GameplayKit/GKRandomDistribution/highestValue) properties.

## Discussion

When using the [`GKRandomDistribution`](/documentation/GameplayKit/GKRandomDistribution) class directly, generated numbers are uniform within the range of the distribution. For example, in a distribution whose lowest value is `1` and highest is `20` (as produced by the [`d20()`](/documentation/GameplayKit/GKRandomDistribution/d20()) class method), `delta` is `1/20 = 0.05`; that is, the distribution returns numbers in 5% increments. Subclasses of [`GKRandomDistribution`](/documentation/GameplayKit/GKRandomDistribution) can alter this quantization, as well as relative probability of generating any particular number within the distribution’s range.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)