|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-9-24 11:34:22
|
显示全部楼层
看fmod的help说明:
Summary #include <math.h>
float fmod (
float x, /* value to calculate modulo for */
float y); /* integer portion of modulo */
Description The fmod function returns a value f such that f has the same sign as x, the absolute value of f is less than the absolute value of y, and there exists an integer k such that:
k * y + f = x
If the quotient x / y cannot be represented, the result is undefined.
Return Value The fmod function returns the floating-point remainder of x / y. 说具体点,谁能帮忙找到这里的C代码?
Example #include <math.h>
#include <stdio.h> /* for printf */
void tst_fmod (void) {
float f;
f = fmod (15.0, 4.0);
printf ("fmod (15.0, 4.0) = %f\n", f);
} |
|