divremcF

fractional divremc module scaled output is the remainder, scaled back to 0-64 range.
Author: Remco van der Most
License: BSD
Github: sss/math/divremcF.axo

Inlets

frac32 in

frac32 denom

Outlets

int32 div

frac32 rem

frac32 scaled

Control Rate
int64_t in = inlet_in;
in = in;
outlet_div = in / inlet_denom;
outlet_rem = in - outlet_div * inlet_denom;
int64_t scaled = outlet_rem;
scaled = scaled << 27;
outlet_scaled = scaled / inlet_denom;

Privacy

© 2024 Zrna Research