ここでかなり奇妙なことが起こります:
float theFloat = 10f * 0.5f * 0.0502913967f;
//result is 0.2514569835f
//but a float's precision is only 7digits so it's false.
//I corrected it, rounded at 6digits, result is 0.251457f
float theFloat = (float)Math.Round((decimal)(10f * 0.5f * 0.0502913967f), 6);
それは大丈夫ですが、別のフロートで使用すると:
Vector2 theVector2 = new Vector2(16302.51f, 0f);
theVector2.X += theFloat;
//means : (16302.51 + 0.251457) = 16302.761457
//but when I check the var the result is : 16302.7607
//so I don't get it...
//also, if theVector2 is 200f more than the previous example (=16502.51f, 0f),
//result is 16502.7617 (200.001f more than previous example's result)
私のエラーはどこですか?お役に立てれば幸いです。