Files
stmbl/src/comps/div.comp
2014-11-25 01:46:04 +01:00

20 lines
248 B
Plaintext

COMP(div);
HAL_PIN(in0) = 0.0;
HAL_PIN(in1) = 0.0;
HAL_PIN(out) = 0.0;
HAL_PIN(div_error) = 0.0;
RC(out,
if(PIN(in1) == 0.0){
PIN(div_error) = 1.0;
}
else{
PIN(div_error) = 0.0;
PIN(out) = PIN(in0) / PIN(in1);
}
);
ENDCOMP;