Greetings, Arie!<br><br><br><div class="gmail_quote">On Dec 11, 2007 6:19 PM, Arie Groeneveld &lt;<a href="mailto:bradypus@xs4all.nl">bradypus@xs4all.nl</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000">
<tt>TK schreef:</tt>
<div><div></div><div class="Wj3C7c"><blockquote type="cite"><tt>He wants to repeatedly sum digits until ( number &lt;
10 ) in order to check divisibility by 9 like<br>
  <br>
  <br>
digitalRoot&nbsp;&nbsp;&nbsp; x = limit ( iterate digitSum x )<br>
  <br>
digitSum 0&nbsp;&nbsp;&nbsp; = 0<br>
digitSum x&nbsp;&nbsp;&nbsp; = ones x + digitSum ( x / 10 )
  <br>
  <br>
  </tt></blockquote></div></div>
<tt>If the problem is checking divisibility by 9,<br>
then I suggest to use what the language offers you:</tt></div></blockquote><div>The problem might be implementing the aforementioned algorithm.<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><tt><font size="2"><span style="font-size: 10pt; font-family: Arial;">div9
:: Int -&gt; Bool</span></font><font size="2"><span dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></tt><div class="Ih2E3d">
<p dir="ltr" style="text-align: left; direction: ltr;"><tt><font size="2"><span style="font-size: 10pt; font-family: Arial;">div9
x</span></font><font size="2"><span dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></tt></p></div>
<p dir="ltr" style="text-align: left; direction: ltr;"><tt><font size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
| x mod 9 == 0 = True</span></font><font size="2"><span dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></tt></p>
<p dir="ltr" style="text-align: left; direction: ltr;"><tt><font size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
|
otherwise = False</span></font><font size="2"><span dir="rtl" style="font-size: 10pt; font-family: Arial;" lang="HE"></span></font></tt><tt><font size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font>
</tt></p></div></blockquote></div>or<br><br>div9 x = x rem 9 == 0<br><br>( StdEnv has no &quot;instance mod Int&quot; )<br><br><br>Wish you all the best.<br><br>TK<br>