Re: FromDigits[{135,21}] -> 1371 (??!!)
- To: mathgroup at smc.vnet.net
- Subject: [mg53751] Re: [mg53725] FromDigits[{135,21}] -> 1371 (??!!)
- From: DrBob <drbob at bigfoot.com>
- Date: Wed, 26 Jan 2005 04:36:38 -0500 (EST)
- References: <200501251003.FAA14402@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
f[a_List]:=StringJoin[ToString/@a]
f@{13,23}
f@{135,42}
1323
13542
FromDigits multiplies by powers of 10 and adds, which explains all your examples perfectly.
Bobby
On Tue, 25 Jan 2005 05:03:24 -0500 (EST), Zak Seidov <seidovzf at yahoo.com> wrote:
> Can anyone please explain what happens,
> if "Digits" actually are "integers":
> FromDigits[{3,2}]
> 32(!)
> FromDigits[{13,2}]
> 132 (!!)
> FromDigits[{135,2}],
> 1352 (!!!)
> FromDigits[{1355078,9}]
> 13550789 (!!!!!!!)
> it's OK above,
> but:
> FromDigits[{135,21}]
> 1371 (??!!)
> FromDigits[{13,23}]
> 153 (??!!)
> FromDigits[{3,23}]
> 53 (??!!)
>
> And how to get integer 1323 from list {13,23}?
>
> So, or there is a better way:
> li={135,42};FromDigits[Flatten[{IntegerDigits[li[[1]]],IntegerDigits[li[[2]]]}]]->
> 13542
>
> Many thanks,
> and if you please send copy to
> seidovzf at yahoo.com
> Zak
>
> PS I use M4.
> M5 also gives
> FromDigits[{135,21}]
> 1371 (??!!)
>
>
>
>
--
DrBob at bigfoot.com
www.eclecticdreams.net
- References:
- FromDigits[{135,21}] -> 1371 (??!!)
- From: seidovzf@yahoo.com (Zak Seidov)
- FromDigits[{135,21}] -> 1371 (??!!)