Forum Discussion
wiens
Jun 25, 2025Brass Contributor
Wrong VBA calculation answer
I am getting for a answer -1. It should be +1. This is calculation error in VBA. I use this version of VBA:
- Jun 30, 2025
This bug has been resolved. I have done a clean installation of Windows and Office.
Kidd_Ip
Jun 26, 2025MVP
To pay safe, try this since VBA evaluates ^ before unary minus unless parentheses are used properly
a = (-y) ^ 2
- wiensJun 26, 2025Brass Contributor
I have tried your method, but the answer is still not correct. I use in Office 365 VBA version 7.1 build 1146.
- wiensJun 30, 2025Brass Contributor
This bug has been resolved. I have done a clean installation of Windows and Office.
- wiensJul 11, 2025Brass Contributor
This problem has been solved in build Windows 11 Insider Preview 27898.1000: "Fixed an underlying issue in the previous flight, which could lead to Math.Pow() not outputting the correct result, which could lead to unexpected behavior in apps and games."