I have been trying to figure out how to deal with any situation when the result is bigger than what a integer declared can hold. For example:
/*
* Old_guy.c
*
*/
#include <stdio.h>
int main()
{
unsigned long int hartbits;
/* years * days * hours * minutes * seconds */
hartbits = 90 * 365 * 24 * 60 * 60; /* approx. bits a 90 years old hart has done */
printf("%d", hartbits); /* integer overflow */
getchar();
return(0);
}
In this case a double makes not difference neither. How does programmers if they need to compute something like 1*2*3*4*5*6...*45?
No knowing this, is bugging me.