Probability in [0, 1] → raw 1e9.
[0, 1]
BigInt probabilityToRaw(double p) { if (p < 0 || p > 1) { throw PredictInputError('probability must be in [0,1], got $p'); } return toRaw(p, 9); }