Registry / Library

library · v0.1.1
Weighted Median Pos
Select the first sorted value index whose cumulative nonnegative weight reaches half the total. Zero total returns minus one.
Use Weighted Median Pos
use vendor::weighted_median_pos::weighted_median_pos;
Run the example
nest demo weighted_median_pos@0.1.1
blyxc native-run weighted_median_pos-demo/main.blyx
Example source and expected output
use vendor::weighted_median_pos::weighted_median_pos;
fn main() {
println!(weighted_median_pos([1,3,1]));
}
Expected output
1
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.1 | Download ZIP · Browse files | 3d483f95ae | 32c868e2ce06f244cedeacdd167095570e29adf30a669feaf03b18934f95c210 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | a059e7c77650e59d89b78e6207d7e6030a50a47d9e96209c59629d0092db398d |