Tutorial by Examples

This function returns the floating-point remainder of the division of x/y. The returned value has the same sign as x. #include <math.h> /* for fmod() */ #include <stdio.h> /* for printf() */ int main(void) { double x = 10.0; double y = 5.1; double modulus = fmod(x,...
C99 These functions returns the floating-point remainder of the division of x/y. The returned value has the same sign as x. Single Precision: #include <math.h> /* for fmodf() */ #include <stdio.h> /* for printf() */ int main(void) { float x = 10.0; float y = 5.1; ...
The following example code computes the sum of 1+4(3+3^2+3^3+3^4+...+3^N) series using pow() family of standard math library. #include <stdio.h> #include <math.h> #include <errno.h> #include <fenv.h> int main() { double pwr, sum=0; int i, n; ...

Page 1 of 1