문제

I am using c++ on my project. However, when I try to make a simple division, it gives me a weird number.

for:

1.0 / 2.0 = -107374176.
1.0 / 3.0 = -107374176.
1 / 3 = -107374176.

any idea why this is happening?

도움이 되었습니까?

해결책

0xCCCCCCCC, a typical value used for uninitialized memory, interpreted as a 32-bit float, equals -107374176. You're printing an uninitialized float value.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top