NormalDistribution constructor

NormalDistribution({
  1. double mean = 0.0,
  2. double std = 1.0,
})

Creates a normal distribution. std must be positive.

Implementation

NormalDistribution({this.mean = 0.0, this.std = 1.0}) {
  if (!mean.isFinite) {
    throw FormatException('mean must be finite, got $mean');
  }
  if (!(std > 0.0) || !std.isFinite) {
    throw FormatException('std must be positive and finite, got $std');
  }
}