Quantile constructor

Quantile(
  1. double quantile,
  2. double error
)

Construct a new quantile with quantile and the allowed error.

Implementation

Quantile(this.quantile, this.error)
    : u = 2.0 * error / (1.0 - quantile),
      v = 2.0 * error / quantile {
  if (quantile < 0.0 || quantile > 1.0) {
    throw ArgumentError.value(
        quantile, 'quantile', 'Expected number between 0.0 and 1.0');
  }
  if (error < 0.0 || error > 1.0) {
    throw ArgumentError.value(
        error, 'error', 'Expected number between 0.0 and 1.0');
  }
}