summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.cpp
diff options
context:
space:
mode:
authorGeotale <Minemaker2006@gmail.com>2024-08-07 14:46:51 -0500
committerGeotale <Minemaker2006@gmail.com>2024-09-03 11:17:24 -0500
commit2f45391ca54bc66dd598edb4dd958a689d2ba806 (patch)
tree7fe0422720787a144a82ce3f491128fcf7b34b22 /Source/Core/Common/StringUtil.cpp
parent9ae560d8a0acf074c493f7c9a060c601146123d6 (diff)
Improve Integer Rounding Accuracy
Changes integer rounding to more closely meet the documentation The documentation explains to round before doing any bounds checks All this really does is make sure some exception bits won't be set wrong This depends on the rounding mode, fixing cases such as: - Round to even, (0x7fffffff, 0x7fffffff.8) - Round to down, (0x7fffffff, 0x80000000) This change also uses some standard functions for rounding Previously using them was casting to an s32 directly, now keeps the f64 RoundToIntegerMode introduced due to roundeven not being part of C++17 Finally, it can change a >0x7fffffff to >=0x80000000, done because: - It looks nicer now with integers (I liked 0s) - It gives ever so slightly better codegen on Aarch64 Co-Authored-By: JosJuice <josjuice@gmail.com>
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
0 files changed, 0 insertions, 0 deletions