Hi all !

   3!:0 <.(^1)*10^i.20
8
   3!:0 <.(^1x)*10x^i.20x
8
   3!:0 <.(x:^1)*x:10^i.20
64
   3!:0 (^1x)
8
   20j18": ^1
2.718281828459045100

Residue in the first two cases works on floats with only 16-17 digits precision and the known comparison tolerance issue which decreases precision even more. The third operation is extended precision. 10^i. 20 happens to be exactly represented as floats I guess. No lost precision there. The Euler constant has no representation as rational I guess. J delivers a float. So you get max 16 or 17 digits precision. The last digits are wrong? Yes, there are lots of opinions you can have about these results. I already expressed mine.

Cheers,
Erling Hellenäs

On 2017-10-09 21:02, Xiao-Yong Jin wrote:
For some reason, all the topics in beta and programming ultimately leads to 
issues relating to our pathetically limited memory computing machines that 
poorly representing proper numbers.

Can we have a separate forum for number representation issues?

Can we have a J operation mode that treats all numbers as extended precision 
rationals by default and barks (or just runs forever) upon irrational numbers?

Here is a question for the proposed new forum as a start.

       NB. J does not get the 15th digit of Euler's number correctly!?
       10|<.(^1)*10^i.20
    2 7 1 8 2 8 1 8 2 8 4 5 9 0 0 0 0 0 0 0
       NB. Putting in x does not help either!?
       10x|<.(^1x)*10x^i.20x
    2 7 1 8 2 8 1 8 2 8 4 5 9 0 0 0 0 0 0 0
       NB. But this x: helps, why?
       10|<.(x:^1)*x:10^i.20
    2 7 1 8 2 8 1 8 2 8 4 5 8 9 1 2 8 1 6 5
----------------------------------------------------------------------
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