Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread Brandon Allbery
Max precision rapidly becomes more memory requires than your computer has. On Sat, Mar 3, 2018 at 3:32 PM, yary wrote: > Or instead of 1/2**(32 or 64), re-asking these questions about epsilon: > > " Why so large? > >Why not zero? " > > What's justification for using

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Still thinking this out. Does the default epsilon influence a Rat == Float comparison? If so, for that purpose, the most useful epsilon is one that maximizes its correctness.

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Or instead of 1/2**(32 or 64), re-asking these questions about epsilon: " Why so large? Why not zero? " What's justification for using 1/100,000 vs. something smaller vs. 0 "max possible precision?"

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Zeroing in on one point: > > A solution might be to instead provide a pragmatic, rather than > mathematical > > parameter: > > > > :$numbits = 64 > > > > This would say to keep as much precision as possible while making the > result > > fit in 64 bits. For example 2.147483647e0.Rat would

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread Brad Gilbert
On Fri, Mar 2, 2018 at 4:33 PM, Jim Avera wrote: > Hello, > > Using Rakudo 2018.01: > > my Rat $rat-from-literal = 1.23456789; > my Rat $rat-from-str = "1.23456789".Rat; > my Real $real = 1.23456789e0; > my Rat $rat-from-real= $real.Rat;