Thank you. Using '16bff' form is clever, but needs some work when the
hex numbers are given in upper case letters as I originally posted.

I didn't know #.^:_1 would work that way.

  #. b. _1
#:
  2 #: 255
1
  2 (#.^:_1) 255        NB. I didn't expect it this way -- look at #.
b. _1 result above.
1 1 1 1 1 1 1 1


2006/9/26, Oleg Kobchenko <[EMAIL PROTECTED]>:
  ]d=.({.@":"0 i.10),(97,:26)];.0 a.
0123456789abcdefghijklmnopqrstuvwxyz

  MN=: d {~ {:@[ #.^:_1 0: ". ":@[EMAIL PROTECTED] , 'b'&,@]

  36 10 MN 'zap'
45745
  10 36 MN '45745'
zap

  54 list, 10 36 <@(MN ":)"1 0 i.12 18
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f  g  h
i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 1g 1h
1i 1j 1k 1l 1m 1n 1o 1p 1q 1r 1s 1t 1u 1v 1w 1x 1y 1z
20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 2g 2h
2i 2j 2k 2l 2m 2n 2o 2p 2q 2r 2s 2t 2u 2v 2w 2x 2y 2z
30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 3g 3h
3i 3j 3k 3l 3m 3n 3o 3p 3q 3r 3s 3t 3u 3v 3w 3x 3y 3z
40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 4g 4h
4i 4j 4k 4l 4m 4n 4o 4p 4q 4r 4s 4t 4u 4v 4w 4x 4y 4z
50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 5g 5h
5i 5j 5k 5l 5m 5n 5o 5p 5q 5r 5s 5t 5u 5v 5w 5x 5y 5z


--- June Kim <[EMAIL PROTECTED]> wrote:

> Hello
>
> Base M and N are given, which are any integer number between 2 and 16
> inclusive. Do the base conversion on a given number(in string form)
> from base M to base N.
>
> My quick trial follows:
>
>    d=:'0123456789ABCDEF'
>    fromM=: [ #. d i. ]
>    toN=:d {~ 13 : 'x&#. ^:_1 y'
>    MN=: ([: {: [) toN ] fromM~ [: {. [
>
>    16 2 MN 'FE'
> 11111110
>    8 16 MN '732'
> 1DA
>
>
> Could you propose a pure tacit version, or more elegant, shorter one?
> I bet there are better ones than mine, as always.
>
> June
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to