我有这个代码;
static int test = 100;
static int Test
{
get
{
return (int)(test * 0.01f);
}
}
Run Code Online (Sandbox Code Playgroud)
输出为:0
但是这段代码会有所不同
static int test = 100;
static int Test
{
get
{
var y = (test * 0.01f);
return (int)y;
}
}
Run Code Online (Sandbox Code Playgroud)
输出是:1
我也有这个代码
static int test = 100;
static int Test
{
get
{
return (int)(100 * 0.01f);
}
}
Run Code Online (Sandbox Code Playgroud)
输出是:1
我看一下IL输出,我不明白为什么C#在编译时执行这个数学运算并输出不同? 
这两个代码有什么区别?为什么我决定使用变量结果正在改变?
我无法从本地或立即窗口更改此"值"变量.怎么了?T 在运行时不是int?

我也无法改变_value.我认为这是一个bug还是什么?
class Program
{
static void Main(string[] args)
{
Just<int> just = new Just<int>();
just.Try(5);
}
}
class Just<T>
{
private T _value;
public void Try(T value)
{
this._value = value;
}
}
Run Code Online (Sandbox Code Playgroud)
除了使用这个,试图使用Just的实例,工作正常