Use require. i.e.
```scala
require(fraction > Double.MinValue && fraction < Double.MaxValue, "...")
```

Shouldn't you just check for fraction > 0 but < 1?