Inhaltsverzeichnis

remainder()

#include <cmath>

double remainder (double x, double y) 

Liefert $r = x - n y$ mit nächstgelegenem ganzzahligen Quotienten $n$. Bei $|n - x/y| = 0.5$ ist $n$ gerade.

Parameter

x Dividend
y Divisor ungleich 0

Ergebnis

Rückgabewert: x REM y nach IEC 60559.

Siehe auch

fmod(), remquo().

Beispiel

remainder.cpp
#include <cmath>
#include <iostream>
 
int main()
{
  double x = 13, y = 5;
 
  std::cout << "Der Rest von " << x << '/' << x 
            << " ist " << std::remainder(x, y) << '\n';
}