ixid: > Can you find an error in my method or shall I post that? Small changes on your version: http://codepad.org/E9KHKvAi > I'll add a cast(T) 1 to the if statement so > it can deal with big ints too. There's no need for that. Bye, bearophile