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

向下向上去整函数

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

标签:blog   io   2014   log   as   file   br   return   class   

  #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,布布扣

向下向上去整函数

标签:blog   io   2014   log   as   file   br   return   class   

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

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