And, most importantly, x: 1%3 1r3
x: is subject to tolerance. The implementation can possibly be improved by using the ideas in https://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations On Thu, Nov 13, 2014 at 7:35 AM, Mike Day <[email protected]> wrote: > FYI > NB. enumerate x:0.333... for between 1 and 20 decimal places > (>:i.20),.x:+/"1 (10^>:i.20)%~"1(3#~])"0>:i.q =. 20 > > 1 3r10 > > 2 33r100 > > 3 333r1000 > > 4 3333r10000 > > 5 33333r100000 > > 6 333333r1000000 > > 7 3333333r10000000 > > 8 1r3 > > 9 166666671r500000014 > > 10 3333333057r9999999173 > > 11 33333330575r99999991726 > > 12 1r3 > > 13 1r3 > > 14 1r3 > > 15 1r3 > > 16 1r3 > > 17 1r3 > > 18 1r3 > > 19 1r3 > > 20 1r3 > > > in Windows 8 - same in J32 & J64 > > > Mike > > > On 13/11/2014 14:56, Ben Gorte - CITG wrote: > >> I guess that's why Linda asked: Should 0.33333333 really be 1r3 ? >> Raul showed that it is. >> >> (I also don't get it) >> ________________________________________ >> From: [email protected] [beta-bounces@forums. >> jsoftware.com] on behalf of Dan Bron [[email protected]] >> Sent: Thursday, November 13, 2014 15:39 >> To: [email protected] >> Subject: Re: [Jbeta] Odd Pattern of Rationals >> >> Linda, exact numbers have to be exact from the get-go. If a number starts >> out inexact, it will stay inexact forever, even if you later apply x: >> (though then it will be quite exactly inexact :). >> >> Thus, to get 1r3 you must say 1r3. If you say 0.333 you'll get 0.333 . >> That's not 1r3 and never will be. >> >> -Dan >> >> ----- Original Message --------------- >> >> Subject: [Jbeta] Odd Pattern of Rationals >> From: "Linda Alvord" <[email protected]> >> Date: Wed, 12 Nov 2014 23:10:14 -0500 >> To: <[email protected]> >> >> Should 0.33333333 really be 1r3 ? >> >> >> >> x: 0.333333 >> >> 333333r1000000 >> >> x: 0.3333333 >> >> 3333333r10000000 >> >> x: 0.33333333 >> >> 1r3 >> >> x: 0.333333333 >> >> 166666671r500000014 >> >> x: 0.3333333333 >> >> 3333333057r9999999173 >> >> >> >> Linda >> >> > > --- > This email is free from viruses and malware because avast! Antivirus > protection is active. > http://www.avast.com > > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2014.0.4765 / Virus Database: 4189/8565 - Release Date: 11/13/14 > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
