码迷,mamicode.com
首页 > 其他好文 > 详细

fmod 函数

时间:2015-03-09 19:06:22      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

  原型:float fmod(float x, float y);
  头文件:#include <math.h>
  功能:计算x/y的余数
  代码示范:

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <ctype.h>
#include <time.h>
#include <queue>
#include <iterator>

using namespace std;

double a, b;

int main()
{
	a = 7.2, b = 6;
	printf("%.3lf\n", fmod(a, b));
	a = -7.2, b = 6;
	printf("%.3lf\n", fmod(a, b));
	return 0;
}

技术分享

fmod 函数

标签:

原文地址:http://blog.csdn.net/u014427196/article/details/44158235

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!