User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







cpp:cmath:fmod

Table of Contents

fmod

    double fmod(double, double );

returns the remainder of a statement

cpp Sourcecode Example

#include <iostream> /* including standard library */
#include <cmath> /* including math library */
 
using namespace std;
int main ( void ) 
{
    double y,x;
    x = 9;
    y = 4.2;
 
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);
 
    cout << "rest of " << x << " / " << y << " is " << fmod(x,y) << endl;
    return 0;
}

output

 rest of 9 / 4.2 is 0.6

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
cpp/cmath/fmod.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz