Float VS Double Vs Decimal [英] 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)
{
}
}
推荐答案
Double比float更精确,decimal更精确,而不是double。
Double is more precise than float and decimal is more precise than double.
这篇关于Float VS Double Vs Decimal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!