divremc

divide integer with constant, also outputs remainder (modulo). Uses integer input to set denominator
Author: Johannes Taelman, changed by Remco van der Most
License: BSD
Github: sss/math/divremc.axo

Inlets

int32 nominator

int32 denominator

Outlets

int32 remainder of division by denominator

int32 a divided by denominator

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

Privacy

© 2024 Zrna Research