Blyx Nest Blyx language
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.

Source repository · Package JSON

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

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse files3d483f95ae32c868e2ce06f244cedeacdd167095570e29adf30a669feaf03b18934f95c210
0.1.0Download ZIP · Browse files6349f23784a059e7c77650e59d89b78e6207d7e6030a50a47d9e96209c59629d0092db398d