📄 fmod.c
字号:
/****************************************************************************/
/* fmod v2.54 */
/* Copyright (c) 1996-2004 Texas Instruments Incorporated */
/****************************************************************************/
#ifndef _MATH
#undef _INLINE
#endif
#include <math.h>
/****************************************************************************/
/* FMOD() - Floating point remainder */
/* */
/* Returns the remainder after dividing x by y an integral number of times.*/
/* */
/****************************************************************************/
double fmod(double x, double y)
{
double d = fabs(x);
/*************************************************************************/
/* if y is too small, any remainder is negligible. */
/*************************************************************************/
if (d - fabs(y) == d) return (0.0);
/*************************************************************************/
/* otherwise, divide; result = dividend - (quotient * divisor) */
/*************************************************************************/
modf(x/y, &d);
return (x - d * y);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -