Blyx Nest Blyx language
Registry / Library
library · v0.1.0

FloorBreach

Locate the first reserve breach and count all deficient period ends.

Source repository · Package JSON

Use FloorBreach

use vendor::floorbreach::floorbreach;

Run the example

nest demo floorbreach@0.1.0
blyxc native-run floorbreach-demo/main.blyx
Example source and expected output
use vendor::floorbreach::floorbreach;

fn main() {
    let opening = 20.0;
    let flows = [-15, -10, 30];
    let reserve = 10.0;
    let result = floorbreach_trace(opening, flows, reserve);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

0
2
15

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIPc53a904a68524d1951a31a7ad6389e0d332af670492fc0c04412bbe3b884a979e75d5fcd4d