首页 > 其他 > 详细

向下向上去整函数

时间:2014-12-02 01:36:43      阅读:253      评论:0      收藏:0      [点我收藏+]

  #include <stdio.h>
  #include <math.h>

  int main ()
  {
   printf ("floor of 2.3 is %d\n", (int )floor (2.3) );
   printf ("floor of 2.6 is %d\n", (int)floor (2.6) );
   printf ("floor of -2.3 is %d\n", (int)floor (-2.3) );
   printf ("floor of -2.6 is %d\n", (int )floor (-2.6) );
   printf ("floor of 2.3 is %d\n", (int )ceil (2.3) );
   printf ("floor of 2.6 is %d\n", (int )ceil (2.6) );
   printf ("floor of -2.3 is %d\n", (int )ceil (-2.3) );
   printf ("floor of -2.6 is %d\n", (int)ceil (-2.6) );
   printf("%d",(int )-2.3);
  return 0;
 }


bubuko.com,布布扣

向下向上去整函数

原文:http://blog.csdn.net/u013076044/article/details/41662739

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!