# How to read this Euclidean Algorithm?

Page 1 of 1

## 8 Replies - 4150 Views - Last Post: 23 September 2012 - 04:35 PM

### #1 deprosun

• D.I.C Regular

Reputation: 0
• Posts: 307
• Joined: 16-November 10

# How to read this Euclidean Algorithm?

Posted 22 September 2012 - 08:11 AM

I am not quite sure what forum this question should have been more appropriate for, so i posted it here. So my question is, how would i read the following expression?
__________________________________________

procedure gcd(a,b: positive integers)
x := a
y := b
while y not equal to 0
r := x mod y
x := y
y := r
return x{gcd( a,b ) is x}

This post has been edited by deprosun: 22 September 2012 - 11:18 AM

Is This A Good Question/Topic? 0

## Replies To: How to read this Euclidean Algorithm?

• Saucy!

Reputation: 6237
• Posts: 24,002
• Joined: 23-August 08

## Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 08:28 AM

Moved to Computer Science

### #3 sepp2k

• D.I.C Lover

Reputation: 2307
• Posts: 3,568
• Joined: 21-June 11

## Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 08:52 AM

What do you mean, how do you read it? Which part are you having trouble reading?

PS: When using a syntax that relies on indentation for semantics (like your pseudo code notation does), you should use code-tags, not manual syntax highlighting, so that the indentation is not lost.

This post has been edited by sepp2k: 22 September 2012 - 08:52 AM

### #4 deprosun

• D.I.C Regular

Reputation: 0
• Posts: 307
• Joined: 16-November 10

## Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 11:25 AM

sepp2k, on 22 September 2012 - 10:52 AM, said:

What do you mean, how do you read it? Which part are you having trouble reading?

PS: When using a syntax that relies on indentation for semantics (like your pseudo code notation does), you should use code-tags, not manual syntax highlighting, so that the indentation is not lost.

I cant understand this sign ":="
x := a
r := x mod y

### #5 sepp2k

• D.I.C Lover

Reputation: 2307
• Posts: 3,568
• Joined: 21-June 11

## Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 11:45 AM

It's the assignment operator.

### #6 KYA

• Wubba lubba dub dub!

Reputation: 3186
• Posts: 19,211
• Joined: 14-September 07

## Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 10:08 PM

Most textbooks devote a section of the first chapter or "pre" parts to explaining the syntax they adapt throughout the book.

### #7 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11785
• Posts: 44,287
• Joined: 27-December 08

## Re: How to read this Euclidean Algorithm?

Posted 23 September 2012 - 01:00 PM

I have a tutorial on the Euclidean algorithm that you may find helpful.

### #8 deprosun

• D.I.C Regular

Reputation: 0
• Posts: 307
• Joined: 16-November 10

## Re: How to read this Euclidean Algorithm?

Posted 23 September 2012 - 03:31 PM

Thanks you so much guys!

### #9 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11785
• Posts: 44,287
• Joined: 27-December 08

## Re: How to read this Euclidean Algorithm?

Posted 23 September 2012 - 04:35 PM