Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Common denominator in tables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60731] Re: Common denominator in tables?
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Mon, 26 Sep 2005 01:36:08 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 9/25/05 at 2:36 AM, kristophs.post at web.de (kristoph) wrote:

>Any idea how to get common denominators for tables or if possible
>for each row of the table? thanks.

First generate some data

In[1]:=
data = Table[
        Random[Integer, {2, 4}]*Random[Integer, {1, 10}], 
        {5}, {5}]
Out[1]=
{{24, 12, 27, 36, 15}, 
  {40, 12, 6, 32, 10}, 
  {9, 20, 20, 16, 24}, 
  {16, 14, 4, 12, 4}, 
  {12, 24, 4, 12, 6}}
 
then find the greatest common divisor of each row

In[2]:=
GCD@@@data
Out[2]=
{3, 2, 1, 2, 2}
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Changing Ticks to Rationals
  • Next by Date: Re: Changing Ticks to Rationals
  • Previous by thread: Common denominator in tables?
  • Next by thread: MathLink for Python?