Float VS Double Vs Decimal [英] Float VS Double Vs Decimal

查看:84
本文介绍了Float VS Double Vs Decimal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为A的类,当我尝试以下面的方式调用哪个方法将首先调用以及为什么???

I Have a class named A which having three overloaded methods when i try to call in below manner which method will call first and why???

公共类A

    {

        public void demo(浮动a)

        {

$
        }¥b $ b        public void demo(十进制b)

        {

$
        }¥b $ b        public void demo(双b)

        {

$
        }


    }

public class A
    {
        public void demo(float a)
        {

        }
        public void demo(decimal b)
        {

        }
        public void demo(double b)
        {

        }

    }

推荐答案

https://social.msdn.microsoft.com/Forums/vstudio/en-US/921a8ffc-9829-4145-bdc9- a96c1ec174a5 / decimal-vs-double-difference?forum = csharpgeneral

Double比float更精确,decimal更精确,而不是double。

Double is more precise than float and decimal is more precise than double.


这篇关于Float VS Double Vs Decimal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆