mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: deprecate short struct init (#10842)
This commit is contained in:
4
vlib/rand/dist/dist.v
vendored
4
vlib/rand/dist/dist.v
vendored
@@ -40,7 +40,7 @@ pub struct NormalConfigStruct {
|
||||
|
||||
// normal_pair returns a pair of normally distributed random numbers with the mean mu
|
||||
// and standard deviation sigma. If not specified, mu is 0 and sigma is 1. Intended usage is
|
||||
// `x, y := normal_pair(mu: mean, sigma: stdev)`, or `x, y := normal_pair({})`.
|
||||
// `x, y := normal_pair(mu: mean, sigma: stdev)`, or `x, y := normal_pair()`.
|
||||
pub fn normal_pair(config NormalConfigStruct) (f64, f64) {
|
||||
if config.sigma <= 0 {
|
||||
panic('The standard deviation has to be positive.')
|
||||
@@ -66,7 +66,7 @@ pub fn normal_pair(config NormalConfigStruct) (f64, f64) {
|
||||
|
||||
// normal returns a normally distributed random number with the mean mu and standard deviation
|
||||
// sigma. If not specified, mu is 0 and sigma is 1. Intended usage is
|
||||
// `x := normal(mu: mean, sigma: etdev)` or `x := normal({})`.
|
||||
// `x := normal(mu: mean, sigma: etdev)` or `x := normal()`.
|
||||
// **NOTE:** If you are generating a lot of normal variates, use `the normal_pair` function
|
||||
// instead. This function discards one of the two variates generated by the `normal_pair` function.
|
||||
pub fn normal(config NormalConfigStruct) f64 {
|
||||
|
||||
Reference in New Issue
Block a user