Visual Studio not assigning float values when stepping over code when debugging

McLellan, Steve 0 Reputation points
2026-07-08T18:31:17.05+00:00

Using:

Microsoft Visual Studio Professional 2019

Version 16.11.57

VisualStudio.16.Release/16.11.57+37327.17

In a C++ project I have a line of code as follows:

float test = 1.0f / 3.0f;

When I set a breakpoint on this line and step over it (F10) it assigns the value of 0.0.

If I set a breakpoint after this line it has a value of 0.3333333 as expected.

Developer technologies | Visual Studio | Debugging
0 comments No comments

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.