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
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
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