-
What's the point — it's meaningless.
-
Your example shows an int not a double. Doubles have infinite digits right of the decimal point.
Not compiled, not tested, just typed.
int sum_of_digits(uint n){ int sum=0; while(n>0){ sum += n % 10; n /= 10; } return sum < 10 ? sum : sum_of_digits(sum); }
Not compiled, not tested, just typed.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
for example
33506 =====> 17 =====> 8
25822 =====> 19 =====> 10 ======> 1