32-bit fixed-point overflow

I do some “early computing” on a 32-bit Windows PC and look at the limits.

Now 2 ** 32 is 4,294,967,296, and I found that

4294967290 + 5 

excellent and

  4294967290 + 6 

it overflows quite correctly.

What puzzles me is that

  429496729 * 10 

although product 4294967290 is in range.

Anyone interested?

+4
source share
1 answer

In the absence of any code, I would suggest that 429496729 gets an implicit typed signed integer for which 4294967290 too much.

+4
source

Source: https://habr.com/ru/post/1341993/


All Articles