divremc

divide integer with constant, also outputs remainder (modulo)
Author: Johannes Taelman
License: BSD
Github: math/divremc.axo

Inlets

int32 nominator

Outlets

int32 a divided by denominator

int32 remainder of division by denominator

Attributes

spinner denominator

Control Rate
int r;
if (inlet_a >= 0)
  r = ((unsigned int)inlet_a) / attr_denominator;
else
  r = -(((unsigned int)(attr_denominator - inlet_a)) / attr_denominator);
outlet_div = r;
outlet_rem = inlet_a - (r * attr_denominator);

Privacy

© 2024 Zrna Research