Thanks @peter for starting this and thanks to all those who participated either as making challenges or solving them . Also a big shout-out again to @peter for the above artwork
The Challenge
Sum of Digits :
The challenge is to Kode procedure for finding the sum of digits of a given number until the sum we get is a single digit.
Here is my Try
Disclaimer: I knew the fact that the digital root of multiples of 9 is always 9 but never thought of using it for other numbers until I saw @pavi2410 post. So basically credits go to her.
(Improper Method): uses RHS limit of 9 which is not possible to write perfectly, so it works for the limited number of digits that can be anything 50, 100, 10000 anything but not for infinite digits. However, if we stretch 9.0000…goeson…0001 to the max limit of computation then it works the same as the above code.
Absolutely no idea.
Interesting @Deepanshu_Arya can you check that data passed to the procedure is same as that of data in callProcedure method. Maybe due to large number of digits it is passing only first few digits.