| LCOV - code coverage report | ||||||||||||||||||||||
|
||||||||||||||||||||||
Line data Source code 1 : package rawschema 2 : 3 : import "math/rand/v2" 4 : 5 : // Roll は Base に 0 以上 Spread 未満の乱数を足す。Spread は1以上であること 6 : func (r RandInt) Roll(rng *rand.Rand) int { 7 1 : return r.Base + rng.IntN(r.Spread) 8 1 : } 9 : 10 : // Mean は Roll の期待値を返す。Spread は1以上であること 11 : func (r RandInt) Mean() float64 { 12 1 : return float64(r.Base) + float64(r.Spread-1)/2 13 1 : } |
| Generated by: LCOV version 2.0-1 |