double modf(double dX, double* dpInteger);
float modf(float, float*); double modf(double, double*); long double modf(long double, long double*);
float modff(float, float*); long double modfl(long double, long double*);
* Note: Since C does not allow function overloading, these other versions of this function exist.
Domain (-∞, ∞) Range (-1, 1) X Integers Periodicity None Symmetry None Asymptotes None |
#include <iostream> #include <cmath> int main() { using namespace std; double dX = -1.2; double dInteger; cout << "x = " << dX << " Fraction = " << modf(dX, &dInteger); cout << " Integer = " << dInteger << endl; dX = 6.2; cout << "x = " << dX << " Fraction = " << modf(dX, &dInteger); cout << " Integer = " << dInteger << endl; return 0; }
© 20072024 XoaX.net LLC. All rights reserved.