zoukankan      html  css  js  c++  java
  • float转int没有所谓的四舍五入

    想起毛爷爷的一句话:“没有调查就没有发言权”。

    using System;
    using System.Collections.Generic;

    namespace ProjectTest
    {
        class cr
        {
            private static void Main()
            {
                float f1 = -123.456F;
                float f2 = -123.567F;
                float f3 = 123.456F;
                float f4 = 123.567F;
                int i1 = (int)f1;
                int i2 = (int)f2;
                int i3 = (int)f3;
                int i4 = (int)f4;
                Console.WriteLine("i1=" + i1);
                Console.WriteLine("i2=" + i2);
                Console.WriteLine("i3=" + i3);
                Console.WriteLine("i4=" + i4);
                Console.ReadLine();
            }
        }
    }

    float转int没有所谓的四舍五入 - crmhf - crmhf的博客

  • 相关阅读:
    win7与centos虚拟机的共享文件夹创建
    MySQL视图
    MySQL分区表与合并表
    PHP读写XML文件的四种方法
    备份与恢复
    MySQL日志
    MySQL锁问题
    优化数据库对象
    ActiveReport资料
    对ArrayList 进行深拷贝
  • 原文地址:https://www.cnblogs.com/crmhf/p/3823136.html
Copyright © 2011-2022 走看看