You can get random floating numbers also.
?3 4$0
0.963872 0.871029 0.675376 0.616793
0.571841 0.705857 0.622286 0.188883
0.581309 0.92616 0.155295 0.766284
100*?3 4$0
10.1327 19.6606 89.967 66.7631
71.2558 4.48547 0.0380807 58.7661
53.0584 79.5548 10.1365 39.501
?10$i.3
0.874544 0 0 0.51129 0 1 0.752359 0 0 0.177596
Linda
iginal Message-----
From: Programming [mailto:[email protected]] On Behalf
Of Matthew Baulch
Sent: Monday, January 11, 2016 1:56 PM
To: [email protected]
Subject: Re: [Jprogramming] Roll (?) produces domain error on large input
Thanks. That makes sense. I confess to not having needed extended precision
from J yet. I'm relieved to know it's implemented that way. Automatically
switching, like you say, would be expensive.
On 12 Jan 2016 4:46 am, "Raul Miller" <[email protected]> wrote:
> On Mon, Jan 11, 2016 at 6:11 AM, Matthew Baulch
> <[email protected]>
> wrote:
> > 2^.!21 is greater than 64 and 2^.!20 is less, so I'm guessing roll
> > is not implemented with arbitrary precision arithmetic.
>
> As Roger Hui pointed out, roll is implemented for arbitrary precision
> numbers (or: you can try that and see that it works).
>
> What it's not implemented for is floating point numbers which require
> arbitrary precision results.
>
> Hopefully that makes sense? (If you think about an array
> implementation, the switch from densely packed numbers to arbitrary
> precision numbers is comparable to the switch from numbers to boxed -
> it's not something people should want to have happen by mistake.)
>
> Thanks,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm