Upon inspection only that indeed looks correct.

Thanks …

On Dec 19, 2013, at 10:28 AM, Louis Wasserman wrote:

> Here's one approach that works: there is overflow iff 
> 
> compareUnsigned(first, divideUnsigned(MAX_UNSIGNED, radix)) > 0 || (first == 
> divideUnsigned(MAX_UNSIGNED, radix) && second > 
> remainderUnsigned(MAX_UNSIGNED, radix));
> 
> Since radix <= Character.MAX_RADIX, you can precompute the divides and 
> remainders in a small table.

Reply via email to