find closest value to k/ploidy for medianValue
| 1331 | |
| 1332 | //find closest value to k/ploidy for medianValue |
| 1333 | float round_by_ploidy(float value, int ploidy) { |
| 1334 | if (value >0) |
| 1335 | return float(int(value*ploidy + 0.5))/ploidy; |
| 1336 | return float(int(value*ploidy))/ploidy; |
| 1337 | } |
| 1338 | |
| 1339 | int round_f(float r) { |
| 1340 | return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); |
no outgoing calls
no test coverage detected