zoukankan      html  css  js  c++  java
  • C#和VB中浮点数到整数的转换

    C#和VB中浮点数到整数的转换

    /* C#
         int a1 = (int)(3.22324);//3
         int a2 = (int)(3.82324);//3
         int a3 = (int)(-3.22324);//3
         int a4 = (int)(-3.82324);//3

         int b1 = (int)Math.Round(3.22324);//3
         int b2 = (int)Math.Round(3.82324);//4
         int b3 = (int)Math.Round(-3.22324);//-3
         int b4 = (int)Math.Round(-3.82324);//-4

         int c1 = (int)Math.Ceiling(3.22324);//4
         int c2 = (int)Math.Ceiling(3.82324);//4
         int c3 = (int)Math.Ceiling(-3.22324);//-3
         int c4 = (int)Math.Ceiling(-3.82324);//-3

         int d1 = (int)Math.Floor(3.22324);//3
         int d2 = (int)Math.Floor(3.82324);//3
         int d3 = (int)Math.Floor(-3.22324);//-4
         int d4 = (int)Math.Floor(-3.82324);//-4
         * */
        /* VB
         a1 = Int(3.22324);//3
         a2 = Int(3.82324);//3
         a3 = Int(-3.22324);//-4
         a4 = Int(-3.82324);//-4
         * */

  • 相关阅读:
    注册表开启或关闭ie浏览器-局域网设置-自动监测设置
    关于win32接口文档位置
    网站添加天气预报插件
    json
    re正则
    配置文件
    logging日志模块
    hashlib加密
    sys模块
    os模块
  • 原文地址:https://www.cnblogs.com/swnuwangyun/p/1266652.html
Copyright © 2011-2022 走看看