2021年3月2日星期二

== between float and decimal in C#

static void Main()  {       int a;       Console.WriteLine(Convert.ToSingle()==Convert.ToDecimal());  }  

Why this code throws an error as "== cannot be applied to operands of type float and decimal"? Even if both the convert statements return 10.

https://stackoverflow.com/questions/66450517/between-float-and-decimal-in-c-sharp March 03, 2021 at 11:51AM

没有评论:

发表评论