6 ms·
case class Probability(value: Double) { require(value <= 0 && value >= 1, "probability must be between 0 and 1" }
by rockostrich 9y ago
case class Probability(value: Double) { require(value <= 0 && value >= 1, "probability must be between 0 and 1" }
- hellofunk 9y agoWhat's the language and what does "require" do? Is that a compile-time mechanism?