0 <= rn2(x) < x */
| 92 | |
| 93 | /* 0 <= rn2(x) < x */ |
| 94 | int |
| 95 | rn2(int x) |
| 96 | { |
| 97 | #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) |
| 98 | if (x <= 0) { |
| 99 | impossible("rn2(%d) attempted", x); |
| 100 | return 0; |
| 101 | } |
| 102 | x = RND(x); |
| 103 | return x; |
| 104 | #else |
| 105 | return RND(x); |
| 106 | #endif |
| 107 | } |
| 108 | |
| 109 | /* 0 <= rnl(x) < x; sometimes subtracting Luck; |
| 110 | good luck approaches 0, bad luck approaches (x-1) */ |
no test coverage detected