On 1/10/08, Nico Heinze <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Use a check like this: {C syntax}
>
> #include <limits.h>
> ...
>
> if (MAXINT / a > b)
> { c = a * b;
> /* here you are safe. */
> ...
> }
> else
> { perror( "a * b would overflow!);
> exit( EXIT_FAILURE);
> }
>
> The name MAXINT is wrong, but currently I don't have a Unix system to
> look it up; search the header file limits.h, you will find many
> constants there.
>
> Regards,
> Nico
>Thanks Nico, I should have been able to figure that out myself, but I guess my brain isn't working right today. Pete. -- Pete Calvert Simple Geek Test: How many syllables in coax?
