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

ValueBounds

Check a numeric setting against inclusive bounds and explain the violation.

Source repository · Package JSON

Use ValueBounds

use vendor::valuebounds::valuebounds;

Run the example

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

fn main() {
    let value = 12.0;
    let minimum = 0.0;
    let maximum = 10.0;
    let result = valuebounds_check(value, minimum, maximum);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

0
10
2

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP67af9352e8863e6911c233c1b868bc00bb7ce8c7580564bcbd6f9b482aafbf40e663cf9a8d