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)
Comments (1)
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
- GfxDevice::UpdateBufferRanges when running UIBuilder tests
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
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