Jump to content
Sign in to follow this  
greggklein

Greatest Common Factor

Recommended Posts

greggklein

Is there an easier way to find Greatest Common Factor:

Do

$x = Random(1,500,1)

$y = Random(1,500,1)

Until $x < $y

While $y/$x > Floor($y/$x)

$newx = $x

$x = $y-$x*Floor($y/$x)

$y = $newx

WEnd

$gcf = $x

MsgBox("","GCF","The GCF of "&$x& " and "& $y& " is "&$x)

Share this post


Link to post
Share on other sites
JustinReno

Yes.

Share this post


Link to post
Share on other sites
greggklein

Yes.

what is it?

Share this post


Link to post
Share on other sites
JustinReno

Thats for you to ask in the correct subforum.

Share this post


Link to post
Share on other sites
greggklein

Thats for you to ask in the correct subforum.

what sub forum would taht be?

Share this post


Link to post
Share on other sites
JustinReno

What do you think it is?

Share this post


Link to post
Share on other sites
greggklein

What do you think it is?

why are you running me around

Share this post


Link to post
Share on other sites
JustinReno

I'm not, its common sense to post in the H-E-L-P forum when you need help, not in the forum "Post your cool and finished scripts"

Edit: Typo

Edited by JustinReno

Share this post


Link to post
Share on other sites
greggklein

I'm not, its commen sense to post in the H-E-L-P forum when you need help, not in the forum "Post your cool and finished scripts"

This site is not well organized. I didn't ralize I was in the wrong place. Next time just tell me where, instead of f'n with me

Share this post


Link to post
Share on other sites
JustinReno

Its organized perfectly well. Only people who cannot identify context clues to post in the right sub forum say that.

Share this post


Link to post
Share on other sites
Innovative

Its organized perfectly well. Only people who cannot identify context clues to post in the right sub forum say that.

Correction , it should be , only people who are disabled in some ways cannot identify the correct section to post .

Share this post


Link to post
Share on other sites
ProgAndy

Thers another way, I think I found it on wikipedia:

Func _EuklidGGT($zahl1, $zahl2)
    while $zahl2 <> 0
        $temp =   Mod($zahl1, $zahl2)
        $zahl1 = $zahl2
        $zahl2 = $temp
    WEnd
    return $zahl1
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×