fmod (Function)

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

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 (float): The dividend
  • y (float): The divisor

Returns: float

Example

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