(avg: number, min = 0, max = avg * 3)
| 36 | } |
| 37 | |
| 38 | function randomInt(avg: number, min = 0, max = avg * 3): number { |
| 39 | return Math.max(min, Math.min(max, Math.round(avg + (Math.random() - 0.5) * (max - min)))); |
| 40 | } |
| 41 | |
| 42 | function randomCoordinate(min: number, max: number): number { |
| 43 | return min + (secureRandomInt(0, 1_000_000) / 1_000_000) * (max - min); |
no outgoing calls
no test coverage detected