component minn "Output the minimum of all inputs";
pin out float out "Follows the smallest value of all in pins";
pin in float in#.[pincount];

instanceparam int pincount = 2;

option MAXCOUNT 16;

function _;
license "GPL";
author "Alexander Roessler";
;;
#include "rtapi_math.h"

FUNCTION(_)
{
    int i;
    hal_float_t value;

    value = in_(0);
    for (i = 1; i < local_pincount; ++i) {
        value = rtapi_fmin(value, in_(i));
    }

    out = value;

    return 0;
}
