On Sun, May 15, 2022 at 3:38 PM David Lambert wrote:
> Dr. Iverson disavowed operator overloading.
I would be interested in seeing the paragraph (or whatever chunk of
text) you are referring to.
> Since otherwise this seems
> like a great case for overloading I propose a new feature. In this, th
Dr. Iverson disavowed operator overloading. Since otherwise this seems
like a great case for overloading I propose a new feature. In this, the
rational precision is specified as maximum either denominator or number
of digits therein, and set as a global parameter. Currently it exists
as _ .
I would have used 50j48 ": ([: +/ %@:!)@i. 2 1 1 $ 30 40x except that
we want pi, instead of e.
For pi:
50j48":<.@o.&.(*&(10x^48))1
3.141592653589793238462643383279502884197169399375
Thanks,
--
Raul
On Sun, May 15, 2022 at 1:37 PM David Lambert wrote:
>
> A global setting determines defau
A global setting determines default floating print precision. Format
accepts customization. Rationals print to arbitrary base 10 representation.
9!:10'' NB. show print precision
6
1p1
3.14159
9!:11 ] 16 NB. set default
1x1
2.718281828459045
NB. customize
":!.3 ] 2p1
I actually made a video for Pi day showing this technique and the various
adjustments you need to make to get pi in an extended form from its original
float representation.
https://youtu.be/vyILnD0e2IE
Cheers, bob
> On May 15, 2022, at 07:12, Jan-Pieter Jacobs
> wrote:
>
> actually, J lets
actually, J lets you approximate pi to as many digits as you'd want, but
you have to know the trick:
pix =. ([: <.@:o. 10^x:)
_10 ]\ ": pix 100
3141592653
5897932384
6264338327
9502884197
1693993751
0582097494
4592307816
4062862089
9862803482
5342117067
9
gives the first 101 digits of pi (inclu
J has a few different ways of representing numbers, including:
- Machine integers (limited to 64 or 32 bit); this is what you get if you type
a number like 123
- Machine floating-point numbers (limited precision, but can have decimal
points in them); this is what you get if you type a number l
Dear All,
i come back to start in J
in jijx>tour>overview
3p5 NB. Pi (3 * Pi ^ 5)
918.059
may be it is not the better way to find Pi :
1p1 NB. Pi (1 * Pi ^ 1)
1p1
3.14159
1p1x
|ill-formed number
| 1p1x
| ^
but this is ok for :
^/ 2 3 4