V
Vivi
I am trying to find an elegant solution for the "unsigned __int64
overflow problem" or in general an "unsigned int overflow detection
problem". In particular, I just have written a little program that
calculates "aliquot sequences" using unsigned __int64. That gives me
integers up to 19 digits and that's all I need for now, but the
sequences often grow fast beyond the _UI64_MAX (maximum value of
__int64) and in that case, the __int64 variables assume incorrect
values (pretty much, garbage).
I was wondering if there is an elegant way, not crucially affecting
the calculation speed, of detecting if an unsigned __int64 (or any
other unsigned int) variable "got over the limit".
Thanks, Vivi
overflow problem" or in general an "unsigned int overflow detection
problem". In particular, I just have written a little program that
calculates "aliquot sequences" using unsigned __int64. That gives me
integers up to 19 digits and that's all I need for now, but the
sequences often grow fast beyond the _UI64_MAX (maximum value of
__int64) and in that case, the __int64 variables assume incorrect
values (pretty much, garbage).
I was wondering if there is an elegant way, not crucially affecting
the calculation speed, of detecting if an unsigned __int64 (or any
other unsigned int) variable "got over the limit".
Thanks, Vivi