[Oberon] Understanding ORS.Mod.txt

Srinivas Nayak sinu.nayak2001 at gmail.com
Mon Jun 13 15:04:15 CEST 2016


Dear Friends,

For a moment, it was completely erased from my brain that
an even number when divided by two can also result an odd number.
Shame on me.

Many thanks for your help on correcting me.
Now I got all the answers to my questions.
1. slen includes NUL.
2. +4 is a heuristic.
3. RETURN x is correct.

It is true that instrumenting a code to produce a trace for understanding the algorithm is cheating.
It just gives pleasure with a couple of examples.
But to realize that the algorithm really works, we have to ponder "why this algorithm work?"
That's my next job...


With thanks and best regards,

Yours sincerely,
Srinivas Nayak

Home: http://www.mathmeth.com/sn/
Blog: http://srinivas-nayak.blogspot.in/

On 06/13/2016 09:43 AM, Chris Burrows wrote:
>> -----Original Message-----
>> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
>> John R. Strohm
>> Sent: Monday, 13 June 2016 12:48 PM
>> To: ETH Oberon and related systems
>> Subject: Re: [Oberon] Understanding ORS.Mod.txt
>>
>> Ten(n) calculates 10**n, using optimized continued multiplication.
>>
>> You are confusing the local variable x inside function Ten with the
>> variable x in the caller of Ten.
>>
>
> OK - I get it now. However, I can see why Srinivas was confused.
>
> @Srinivas: If e = 5 then the values of e are 5, 2, 1 so e does become odd a
> second time.
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> .
>


More information about the Oberon mailing list