+ 3

Need help with this calculator I created for Pascal's Triangle (using C++)

My issue is that around the 30th row of calculation it starts to make a calculation that is impossible when my input was a positive integer, it calculates a negative integer and quickly starts to calculate 0 my code has been published for some constructive criticism, so if there is a better way to this please let know so I can try again

6th Jan 2017, 1:13 AM
Christopher Carillo
Christopher Carillo - avatar
1 Resposta
+ 1
Row 30 has really big numbers, you should test if they are bigger than the maximal integer value. If you assign a number to a variable that's bigger than it's maximum it might loop back to the negative numbers.
6th Jan 2017, 1:30 AM
Robobrine
Robobrine - avatar