fmod (Function)

Signature: fmod(x: t0, y: t0) -> t0

Description: The C fmod: the remainder of x/y with x's sign, truncating toward zero. Total: a zero divisor yields NaN, unlike the % operator's Arith policy.

Parameters

  • x (t0): The dividend
  • y (t0): The divisor

Returns: t0

Example

print(fmod(-7.5, 2.0))  // -1.5
print (fmod (-7.5, 2.0))  // -1.5