Jump to content

Greatest Common Factor


Recommended Posts

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...