You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/stdlib_stats_distribution_normal.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,17 @@ With two arguments, the function returns a normal distributed random variate \(N
23
23
24
24
With three arguments, the function returns a rank-1 array of normal distributed random variates.
25
25
26
+
With two arguments `array_size` and `mold`, the function returns a rank-1 array of standard normal distributed random variates \(N(0,1)\), where the `mold` argument is used only to determine the output type and kind.
27
+
26
28
@note
27
29
The algorithm used for generating exponential random variates is fundamentally limited to double precision.[^1]
Elemental function (passing both `loc` and `scale`).
@@ -40,13 +44,15 @@ Elemental function (passing both `loc` and `scale`).
40
44
41
45
`scale`: optional argument has `intent(in)` and is a positive scalar of type `real` or `complex`.
42
46
43
-
`array_size`: optional argument has `intent(in)` and is a scalar of type `integer`.
47
+
`array_size`: optional argument has `intent(in)` and is a scalar of type `integer`. When used with `loc` and `scale`, specifies the size of the output array. When used with `mold`, must be provided as the first argument.
48
+
49
+
`mold`: optional argument has `intent(in)` and is a scalar of type `real` or `complex`. Used only to determine the type and kind of the output; its value is not referenced. When provided, generates standard normal variates \(N(0,1)\).
44
50
45
51
`loc` and `scale` arguments must be of the same type.
46
52
47
53
### Return value
48
54
49
-
The result is a scalar or rank-1 array, with a size of `array_size`, and the same type as `scale` and `loc`. If `scale` is non-positive, the result is `NaN`.
55
+
The result is a scalar or rank-1 array, with a size of `array_size`, and the same type as `scale` and `loc` (or same type and kind as `mold` when using the `array_size, mold` form). If `scale` is non-positive, the result is `NaN`.
0 commit comments