How should I round a float in this case?
问题 I'm having issues in my code due to the multiple representations that a same float number can have. For instance, these number are considered to be the same: 0.0299999400 0.0300000000 I don't care much for a big precision, I need to calculate CRC of those numbers and they should be the same, so my approach was to use this code: private static float Rounding(float v, float p) { return Mathf.Round (v * p) / p; } Where p is my precision. That seems to be working well, but in that case, if I used