Search Issue Tracker
Fixed
Votes
10
Found in
4.6.4p2
Issue ID
700792
Regression
No
[IL2CPP] Mathf.RoundToInt method doesn't work correctly
To Reproduce:
1. Run the attached script with mono/il2ccpp
2. Observe that IL2CPP returns incorrect values for:
Mathf.RoundToInt(4.5f)
Mathf.RoundToInt(0.5f + float.Epsilon)
Mathf.RoundToInt(0.5f - float.Epsilon)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on mdb_node_search when opening a project
- [macOS] Unable to install VisionOS Module on Hub
- NullReferenceException is thrown when pressing the "Enter" key to select an item in a ListView
- Burst internal compiler errors are thrown when creating a new 2D project
- Tile Paint action disappears from Undo History when Tile Selection tool has been used beforehand
hitorijanai
Jun 11, 2015 00:57
I also have this problem after upgrading Unity to 4.6.5.p3. It seems like a little bug for many, but is a big problem for networked games. I think the real bug is that when you cast a float to int. My temporary solution is to cast to double before casting it to integer (float -> double -> int). Hope this helps