Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Stop The Presses! (https://forums.graalonline.com/forums/showthread.php?t=46766)

TribulationStaff 08-04-2003 03:47 AM

Stop The Presses!
 
I just went to use this, and to my horror, graal returned an error when i hit the test button. Stefan P L E A S E put in a greatest common divisor function into gscript. For those of you who don't know, here are some examples:

gcd(1,500)=1
gcd(12,21)=3
gcd(11,101)=1
gcd(4,16)=4

Kaimetsu 08-04-2003 04:41 AM

Why on Earth would we need something like that? You may as well just code your own.

TribulationStaff 08-04-2003 04:43 AM

Yeah, I could but it would be a pain to put in an NPC every time I need it.


I need it for recursive scripting.

Kaimetsu 08-04-2003 05:29 AM

Quote:

Originally posted by TribulationStaff
I need it for recursive scripting.
Elaborate, please.

TribulationStaff 08-04-2003 05:48 AM

In the case I have in mind, I want to do something by a method of halving, which means I need to work in iterations, and I don't want to overwrite the old steps, so I have configured my for loops such that with a gcd I could do that easily.

Other uses include finding the relative primacy, another way to determine parity, and there are countless recursive formulae which include a gcd.

Kaimetsu 08-04-2003 05:58 AM

*shrugs*

I'll wager there are usually other ways.

Tyhm 08-06-2003 10:59 PM

An ugly For loop will do if nothing else.


All times are GMT +2. The time now is 07:12 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.