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: FromDigits[{135,21}] -> 1371 (??!!)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53755] Re: FromDigits[{135,21}] -> 1371 (??!!)
  • From: "Michael Hartl" <mhartl at post.harvard.edu>
  • Date: Wed, 26 Jan 2005 04:36:54 -0500 (EST)
  • References: <ct561v$e8b$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

FromDigits assumes that its argument is to be converted using base 10,
so FromDigits[{135, 21}] == 135 * 10^1 + 21 * 10^0 == 1371.  To
concatenate the numbers in a list, join them as strings and then
convert back:

In[1]:= ToExpression[StringJoin[ToString /@ {135, 21}]]
Out[1]= 13521

Michael

P.S. Google groups suppresses your full email address, so I couldn't
copy you there.


  • Prev by Date: Re: FromDigits[{135,21}] -> 1371 (??!!)
  • Next by Date: Re: Problems with ExtendGraphics/Delaunay Triangulation
  • Previous by thread: Re: Re: FromDigits[{135,21}] -> 1371 (??!!)
  • Next by thread: Re: FromDigits[{135,21}] -> 1371 (??!!)