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

#1 deprosun  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 296
  • 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?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6092
  • View blog
  • Posts: 23,612
  • Joined: 23-August 08

Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 08:28 AM

Moved to Computer Science
Was This Post Helpful? 1
  • +
  • -

#3 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2151
  • View blog
  • Posts: 3,307
  • 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

Was This Post Helpful? 1
  • +
  • -

#4 deprosun  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 296
  • Joined: 16-November 10

Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 11:25 AM

View Postsepp2k, 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
Was This Post Helpful? 0
  • +
  • -

#5 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2151
  • View blog
  • Posts: 3,307
  • Joined: 21-June 11

Re: How to read this Euclidean Algorithm?

Posted 22 September 2012 - 11:45 AM

It's the assignment operator.
Was This Post Helpful? 2
  • +
  • -

#6 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3116
  • View blog
  • Posts: 19,153
  • 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.
Was This Post Helpful? 1
  • +
  • -

#7 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10781
  • View blog
  • Posts: 40,153
  • 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.
Was This Post Helpful? 1
  • +
  • -

#8 deprosun  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 296
  • Joined: 16-November 10

Re: How to read this Euclidean Algorithm?

Posted 23 September 2012 - 03:31 PM

Thanks you so much guys! :)
macosxnerd101 your tutorial is awesome :)
Was This Post Helpful? 0
  • +
  • -

#9 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10781
  • View blog
  • Posts: 40,153
  • Joined: 27-December 08

Re: How to read this Euclidean Algorithm?

Posted 23 September 2012 - 04:35 PM

Glad we could help! :)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1