RPTools.net

Discussion and Support

Skip to content

It is currently Tue Sep 19, 2017 3:41 pm 






Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Mon Feb 09, 2009 10:53 am
Posts: 416
 Post subject: Lowest common multiple and greatest common divisor
PostPosted: Sun Jul 16, 2017 1:39 pm 
I see there aren't built-in functions for this, so what would you advise to make macros where you can calculate lowest common multiple and greatest common divisor from lists of numbers (possibly with virtually unlimited lists... within reason, of course... I know throwing in a list of a thousand numbers could be taxing... and probably will never have lists longer than ten numbers).

_________________
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7854
Location: Bay Area
 Post subject: Re: Lowest common multiple and greatest common divisor
PostPosted: Sun Jul 16, 2017 6:49 pm 
You mean like factors? So, for 10 it would be 2,5 and 20 would be 2,2,5?

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9373
Location: Netherlands
 Post subject: Re: Lowest common multiple and greatest common divisor
PostPosted: Mon Jul 17, 2017 2:35 am 
multiples of 4: 4,8,12,16,20,24, etc
multiples of 6: 6,12,18,24,etc

Hence the 'common multiples' are: 12,24,36,etc

So the LCM (lowest common multiple) of 4 and 6 is 12

divisors of 4: 1,2,4 (aka factors as AM mentioned)
divisors of 6: 1,2,3,6

'common divisors': 1,2

So the GCD (greatest common divisor) of 4 and 6 is 2.

My Q is: what on earth do you require this for in MT?

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman