Skip to content

shz_remquof

Markdown
SHZ_INLINE float shz_remquof(float num, float denom, float* quot) SHZ_NOEXCEPT;

(Sorta) Replacement for the <math.h> routine, remquof().

NameTypeDescription
numfloat
denomfloat
quotfloat *

float

Returns the floating-point remainder of num divided by denom, rounded to the nearest integer (as a float). quot is set equal to the quotient which is used as part of the calculation.

  • quot is returning as a float rather than an int as with standard C. Simply cast to an int manually afterwards if that is the desired behavior.
  • This routine does not gracefully handle dividing by zero.
  • C++ equivalent: shz::remquof
  • Type-generic form: none
  • Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
  • Defined in: sh4zam/shz_scalar.h:154
  • Module: Scalar, section "Rounding"

shz_remainderf