Uniform (Integer) functions in the Stochastic DuckDB extension
Function category
Uniform (Integer)
21 functionsDiscrete uniform — every integer in [min, max] equally likely. Random index sampling, dice rolls.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
P(X <= x) for the inclusive integer support [min, max]. For integers inside the support this is (x - min + 1) / (max - min + 1).
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_cdf(1, 6, 3);
Output
| dist_uniform_int_cdf(1, 6, 3) |
|---|
| 0.5 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
P(X > x) for the inclusive integer support, computed directly for the upper tail.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_cdf_complement(1, 6, 3);
Output
| dist_uniform_int_cdf_complement(1, 6, 3) |
|---|
| 0.5 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Cumulative hazard -ln(P(X > x)). Returns positive infinity at or above max.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_chf(1, 6, 3);
Output
| dist_uniform_int_chf(1, 6, 3) |
|---|
| 0.6931471805599453 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Discrete hazard P(X = x) / P(X >= x). Returns 0 below min and 1 at max; undefined above max (raises an error).
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_hazard(1, 6, 3);
Output
| dist_uniform_int_hazard(1, 6, 3) |
|---|
| 0.25 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Kurtosis of the inclusive discrete uniform distribution. Undefined for equal bounds (zero variance).
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_kurtosis(1, 6);
Output
| dist_uniform_int_kurtosis(1, 6) |
|---|
| 1.7314285714285715 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Excess kurtosis of the inclusive discrete uniform distribution. Undefined for equal bounds (zero variance).
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_kurtosis_excess(1, 6);
Output
| dist_uniform_int_kurtosis_excess(1, 6) |
|---|
| -1.2685714285714285 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Computes the natural logarithm of the cumulative distribution function (CDF) of the uniform_int distribution. Returns the logarithm of the probability that a random variable X is less than or equal to x.
SELECT dist_uniform_int_log_cdf(1, 6, 3);
Output
| dist_uniform_int_log_cdf(1, 6, 3) |
|---|
| -0.6931471805599453 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Computes the natural logarithm of the complementary cumulative distribution function (1 - CDF) of the uniform_int distribution. Returns the logarithm of the probability that X > x, equivalent to the survival function.
SELECT dist_uniform_int_log_cdf_complement(1, 6, 3);
Output
| dist_uniform_int_log_cdf_complement(1, 6, 3) |
|---|
| -0.6931471805599453 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Natural logarithm of the discrete probability mass. Outside the inclusive integer support, returns negative infinity.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_log_pdf(1, 6, 3);
Output
| dist_uniform_int_log_pdf(1, 6, 3) |
|---|
| -1.791759469228055 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Mean of the inclusive discrete uniform distribution: (min + max) / 2, returned as DOUBLE.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_mean(1, 6);
Output
| dist_uniform_int_mean(1, 6) |
|---|
| 3.5 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Midpoint (min + max) / 2, returned as DOUBLE. With an even number of outcomes this can be fractional; _quantile(..., 0.5) returns the lower central integer.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_median(1, 6);
Output
| dist_uniform_int_median(1, 6) |
|---|
| 3.5 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns min as a representative mode. Every integer in the inclusive support has the same probability mass.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_mode(1, 6);
Output
| dist_uniform_int_mode(1, 6) |
|---|
| 1 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
x
|
Type
BIGINT
|
Mode Positional | Description |
Description
Probability mass P(X = x) on the inclusive integer support [min, max]: 1 / (max - min + 1) inside the support and 0 outside.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_pdf(1, 6, 3);
Output
| dist_uniform_int_pdf(1, 6, 3) |
|---|
| 0.16666666666666666 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Smallest supported integer whose CDF is at least p. At p = 0 returns min; at p = 1 returns max. The probability must be finite and between 0 and 1.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max. The probability uses its exact binary DOUBLE value, without epsilon snapping at probability-mass boundaries.
SELECT dist_uniform_int_quantile(1, 6, 0.95);
Output
| dist_uniform_int_quantile(1, 6, 0.95) |
|---|
| 6 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
p
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Smallest supported integer whose upper-tail probability P(X > x) is at most p. At p = 0 returns max; at p = 1 returns min.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max. The probability uses its exact binary DOUBLE value, without epsilon snapping at probability-mass boundaries.
SELECT dist_uniform_int_quantile_complement(1, 6, 0.05);
Output
| dist_uniform_int_quantile_complement(1, 6, 0.05) |
|---|
| 6 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the range of the uniform_int distribution.
SELECT dist_uniform_int_range(1, 6);
Output
| dist_uniform_int_range(1, 6) |
|---|
| [1, 6] |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Generates random samples from the uniform_int distribution with specified parameters.
SELECT dist_uniform_int_sample(1, 6);
Related functions
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns 0 for a nondegenerate discrete uniform distribution. Undefined for equal bounds (zero variance).
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_skewness(1, 6);
Output
| dist_uniform_int_skewness(1, 6) |
|---|
| 0.0 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Square root of the discrete uniform variance, returned as DOUBLE.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_stddev(1, 6);
Output
| dist_uniform_int_stddev(1, 6) |
|---|
| 1.707825127659933 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Returns the support of the uniform_int distribution.
SELECT dist_uniform_int_support(1, 6);
Output
| dist_uniform_int_support(1, 6) |
|---|
| [1, 6] |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
min
|
Type
DOUBLE
|
Mode Positional | Description |
Argument
max
|
Type
DOUBLE
|
Mode Positional | Description |
Description
Variance of the inclusive discrete uniform distribution: ((max - min + 1)^2 - 1) / 12, returned as DOUBLE.
This describes the corrected v1.5 source dated October 7, 2026. Older community builds (including 234c881) have incorrect continuous-uniform analytics and truncated BIGINT moments. Bounds remain DOUBLE arguments but must be finite BIGINT-valued integers with min <= max.
SELECT dist_uniform_int_variance(1, 6);
Output
| dist_uniform_int_variance(1, 6) |
|---|
| 2.9166666666666665 |
Related functions
- dist_uniform_int_sample() — Generates random samples from the uniform_int distribution with specified parameters
- dist_uniform_int_pdf() — Probability mass P(X = x) on the inclusive integer support `[min, max]`: `1 / (max - min + 1)` inside the support and 0 outside
- dist_uniform_int_cdf() — P(X <= x) for the inclusive integer support `[min, max]`
- dist_uniform_int_quantile() — Smallest supported integer whose CDF is at least p
- dist_uniform_int_mean() — Mean of the inclusive discrete uniform distribution: `(min + max) / 2`, returned as DOUBLE
- dist_uniform_int_stddev() — Square root of the discrete uniform variance, returned as DOUBLE