My function has passed unit test, but it writes wrong results sometimes.

Jiaxin Zhang 60 Reputation points
2025-10-11T09:18:16.3266667+00:00

My function has passed unit test, but it writes wrong results sometimes. What’s wrong?

When I test the function, the actual result is equal to expected result. But it writes a different result in the release version of my project.

Strange!

Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.