Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using simple approx round up in ui_layout_system (bevyengine#14079)
# Objective - built-in `f32::round `is slow - splits from bevyengine#14064 ## Solution - using a simple floor instead of round ## Testing - I am not an expert on floating-point values, but I enumerated all f32 values to test for potential errors compared to the previous function. [rust playground](https://play.rust-lang.org/?version=stable&mode=release&edition=2021&gist=0d8ed5604499e7bd9c61ce57d47e8c06) three cases where the behavior differs between the new and previous functions: | value | previous | new | |---|---|---| | [-0.5,0) | -0 | +0 | | 0.49999997 | 0 | 1 | | +-8388609 | 8388609 | 8388610 | ## Performance ![image](https://github.com/bevyengine/bevy/assets/45868716/1910f342-e55b-4f5c-851c-24a142d5c72e)
- Loading branch information