How about this:
toss=: 4 : 0"0
y=. ((>.x^.y) # x) #: y NB. y in base x
y=. y + x * 0=y NB. replace 0 with x
r=. ''
n=. #y
i=. 0
while. i<:#y do.
r=. r, c=. ? p=. i{y
if. c<p do. r=. r,? (n->:i) # x break. end.
end.
x#.r
)
2 toss 10#8
2 4 6 2 0 4 1 5 2 4
2 toss 10#8
4 5 7 0 4 3 6 2 3 6
2 toss 10#8
2 7 4 4 1 1 0 0 3 5
(_1+2^31x) toss 3#2^66x
54577901964967394924 34786398721677175033 4024345107907449541
----- Original Message ----
From: Andrew Nikitin <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, June 13, 2006 8:05:52 PM
Subject: [Jbeta] monadic '?'
?10^100x
|domain error
| ?10^100
Or should it rather go to "suggestion" page?
I tried to implement ? equivalent for large extended numbers, but this is
such a pain. I would be happier if primitive could do it for me.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm