Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
So i found a way to find the Greatest Comum Divisor between two numbers, and it's tested.
If you don't know what GCD is, then or search math OR:
GCD is the highest integer between two number's divisors that matches.
It was coded in LUA just today
C#:
Offline
MCD, also known as GCD (Greatest Common Divisor) for you fellow english folks. This honestly got me confused for a second before I realized you were spanish. Anyway, I guess it's nice to know they have it. Is it really ground-breaking news?
Offline
MCD, also known as GCD (Greatest Common Divisor) for you fellow english folks. This honestly got me confused for a second before I realized you were spanish. Anyway, I guess it's nice to know they have it. Is it really ground-breaking news?
wtfno why does everyone think im spanish
You nuggets it's MARCO NOT MARCOS
ANTONIO NOT ANTONIOS
I'm PT
anyways okay. here its MDC
Offline
Off-topic: Marco and Antonio are also Italian names. Are you Italian?
On-topic: Better solutions where found with the GOOGLE research "greater common factor c#". It's only the 3rd link. It took me 30sec.
Offline
Off-topic: Marco and Antonio are also Italian names. Are you Italian?
On-topic: Better solutions where found with the GOOGLE research "greater common factor c#". It's only the 3rd link. It took me 30sec.
Off-topic: I've said im portuguese. now plsgo.
On-topic: Who cares, I'm showing a new way of reaching there. Can you actually read why Bots and 'Programming' ('Programming') word exists?
Offline
Basically you wanted to create something new and you did it? Well congratulations on your success.
Note: Haters everywhere and people who would rather use google or something else to find answers rather than coming up with it on their own.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
Ok different points:
Yes, "Bots and programming" contains indeed "Programming" (and yes this word exists). However, the problem and solution you show here are (apart from the fact that you gave c# code) not exactly related to EE, but more to general programming.
Do you see me creating topics here about this N-D parametric active contours method I coded recently? (hint: the answer starts with 'n' and finishes with 'o')
And yes, you're super happy because you created a cool code that is very inefficient.
Your algorithm has at least a O(n) complexity, which is (sure), not too bad. However, the Euclidean algorithm (the one used in the link I found) that I learn in middle school (and forgot about) has a way better complexity (O(#of digits²)).
The guy (Euclide) who invented this simple, yet effective algorithm lived in 300 BC.
Do we have to re-invent the wheel every time we create a car? Again, the answer is no. (hopefully, otherwise we would still be fighting each others with sticks n' stones)
I'm a bit sorry it falls on you, but it just gets very annoying: most of the topic on the "Bots and Programming" forum are now wannabe "bot-makers" that do not know how to proofread a code for a missing semicolon or how to use Google to find answers they'll get way faster than posting here.
There is no shame in asking for help, but is it necessary to post it here? Is it really related to EE? Or is it just a general problem? Same goes for the "tips" that people found interesting.
This section seems to be stagnating into the primordial soup of development... T_T
Finally: Now, I don't ask people to simply copy-paste what they found on the net. Most of the time it won't work. You have to read the stuff, understand it, and then rewrite it on your own.
P.S.: Hater? No. I just try to learn from others and there's no shame in that.
P.P.S.: Off-topic was a joke. Humor? Get it?
Offline
Ok different points:
Yes, "Bots and programming" contains indeed "Programming" (and yes this word exists). However, the problem and solution you show here are (apart from the fact that you gave c# code) not exactly related to EE, but more to general programming.
Do you see me creating topics here about this N-D parametric active contours method I coded recently? (hint: the answer starts with 'n' and finishes with 'o')And yes, you're super happy because you created a cool code that is very inefficient.
Your algorithm has at least a O(n) complexity, which is (sure), not too bad. However, the Euclidean algorithm (the one used in the link I found) that I learn in middle school (and forgot about) has a way better complexity (O(#of digits²)).The guy (Euclide) who invented this simple, yet effective algorithm lived in 300 BC.
Do we have to re-invent the wheel every time we create a car? Again, the answer is no. (hopefully, otherwise we would still be fighting each others with sticks n' stones)
I'm a bit sorry it falls on you, but it just gets very annoying: most of the topic on the "Bots and Programming" forum are now wannabe "bot-makers" that do not know how to proofread a code for a missing semicolon or how to use Google to find answers they'll get way faster than posting here.
There is no shame in asking for help, but is it necessary to post it here? Is it really related to EE? Or is it just a general problem? Same goes for the "tips" that people found interesting.
This section seems to be stagnating into the primordial soup of development... T_T
Finally: Now, I don't ask people to simply copy-paste what they found on the net. Most of the time it won't work. You have to read the stuff, understand it, and then rewrite it on your own.
P.S.: Hater? No. I just try to learn from others and there's no shame in that.
P.P.S.: Off-topic was a joke. Humor? Get it?
I am a bot maker but i do not post everything i don't know here. Please...
Also okay.
(I made this from the scratch, plsgo)
Offline
How it should be done in my opinion:
int gcd(int a, int b) {
while(a != b)
if(a < b)
b-= a;
else
a-= b;
return a;
}
Everybody edits, but some edit more than others
Offline
Offline
The operation of subtraction is faster than division, particularly for large numbers
The efficient algorithm is the one who suits the input best...
Edit: Binary GCD algorithm should also be noticed.
Everybody edits, but some edit more than others
Offline
private static int gcd(int a, int b)
{
int t;
// Ensure B > A
if (a > b)
{
t = b;
b = a;
a = t;
}
// Find
while (b != 0)
{
t = a % b;
a = b;
b = t;
}
return a;
}
gotta love google
if you can read this....good for you
Offline
The question is, why does this thread even exist?
Offline
The question is, why does this thread even exist?
Do you want to start a flame war? Because this is how you start a flame war.
Marco just wanted to show his work, so then people offer their criticism to make it better, even if there is a better one on google. This is how this thread works.
@marco
Sorry I got your nationality mixed up, I didn't mean anything by it. I just googled MCD and it turned up spanish.
Offline
The question is, why does this thread even exist?
kurtv13 wrote:The question is, why does this thread even exist?
Do you want to start a flame war? Because this is how you start a flame war.
Marco just wanted to show his work, so then people offer their criticism to make it better, even if there is a better one on google. This is how this thread works.
@marco
Sorry I got your nationality mixed up, I didn't mean anything by it. I just googled MCD and it turned up spanish.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Well guys the advantage of this method is that you actually can check divisores.
Offline
Pages: 1
[ Started around 1732683952.6308 - Generated in 0.294 seconds, 12 queries executed - Memory usage: 1.63 MiB (Peak: 1.85 MiB) ]