⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fmod.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
字号:
.func fmod
#include <math.h>
double fmod( double x, double y );
.ixfunc2 '&Math' &func
.funcend
.desc begin
The &func function computes the floating-point remainder of
.arg x/y,
even if the quotient
.arg x/y
is not representable.
.desc end
.return begin
The &func function returns the value
.arg x &minus. (i * y),
for some integer
.arg i
such that, if
.arg y
is non-zero, the result has the same sign as
.arg x
and magnitude less than the magnitude of
.arg y.
If the value of
.arg y
is zero, then the value returned is zero.
.return end
.see begin
.seelist fmod ceil fabs floor
.see end
.exmp begin
#include <stdio.h>
#include <math.h>

void main()
  {
    printf( "%f\n", fmod(  4.5,  2.0 ) );
    printf( "%f\n", fmod( -4.5,  2.0 ) );
    printf( "%f\n", fmod(  4.5, -2.0 ) );
    printf( "%f\n", fmod( -4.5, -2.0 ) );
  }
.exmp output
0.500000
-0.500000
0.500000
-0.500000
.exmp end
.class ANSI
.system

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -