I wonder why you say "the number below is not correct either".
The following is a demonstration that <[EMAIL PROTECTED]: 2x*10x^2*n computes
the square root of 2 to n decimal places:
n=: 500
s=: <[EMAIL PROTECTED]: 2x*10x^2*n
$ ": s
501
_50 ,@(_5&(' '&,\))\ ": s
14142 13562 37309 50488 01688 72420 96980 78569 67187 53769
48073 17667 97379 90732 47846 21070 38850 38753 43276 41572
73501 38462 30912 29702 49248 36055 85073 72126 44121 49709
99358 31413 22266 59275 05592 75579 99505 01152 78206 05714
70109 55997 16059 70274 53459 68620 14728 51741 86408 89198
60955 23292 30484 30871 43214 50839 76260 36279 95251 40798
96872 53396 54633 18088 29640 62061 52583 52395 05474 57502
87759 96172 98355 75220 33753 18570 11354 37460 34084 98847
16038 68999 70699 00481 50305 44027 79031 64542 47823 06849
29369 18621 58057 84631 11596 66871 30130 15618 56898 72372
3
((i.20)&{"1 ,. ' ',. (495+i.20)&{"1) ": *: ,. s+_1 0 1
19999999999999999999 99999567575656983330
19999999999999999999 99999850418369457949
20000000000000000000 00000133261081932568
The last phrase demonstrate that s-1 is smaller than the square root,
but s+1 is larger.
Perhaps those people with access to Mathematica or Maple can compute
the square root of 2 in those systems as a check.
----- Original Message -----
From: "Don Guinn" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Friday, March 10, 2006 4:52 PM
Subject: Re: [Jprogramming] More precision nightmares
The answer you listed from the web is not correct. It's correct only to
the number of digits listed. The number below is not correct either,
but it's a lot closer.
0j200":(10x^500)%~(<[EMAIL PROTECTED]:)2x*10x^1000
1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558
5073721264412149709993583141322266592750559275579995050115278206057147
...
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm