User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







cpp:cmath:fmod
click
to support this page (eg 0,42 € or so) Thanks.

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
advertising
cpp/cmath/fmod.txt · Last modified: 2012/10/12 18:35 (external edit)

Impressum