![]() |
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 |
Why on Earth would we need something like that? You may as well just code your own.
|
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. |
Quote:
|
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. |
*shrugs*
I'll wager there are usually other ways. |
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.