comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: ackermann number
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: ackermann number [message #77425] Wed, 31 August 2011 02:44
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
On 31 Aug., 10:39, chris <rog...@googlemail.com> wrote:
> Hi folks,
> I try to compute the ackermann number, but unfortunately my code is
> omehow erroneous. Additonally, I need it in hexadecimal form in a text
> file. Some ideas how to solve this problem?
>
> Thanks and best regards
>
> CR
>
> function ack,m,n
>
> while (1) do begin
>         switch m of
>         0       :       return, n+1u
>         1       :       return, n+2u
>         2       :       return, ishft(n,1u)+3u
>         3       :       return, ishft(1u,n+3)-3u
>         else:   begin
>                         if n eq 0 then begin
>                                 n       =       0u
>                         endif else begin
>                                 n       =       ack4(m,n-1u)
>                         endelse
>                         m--
>                         break
>                         end
>         endswitch
> endwhile
> end

A little typo:

n = ack(m,n-1u)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ackermann number
Next Topic: Re: How to eliminate smaller blob from label_region image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:12:46 PDT 2025

Total time taken to generate the page: 0.00551 seconds