Re: sqrt and Buf question

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 14:48, William Michels via perl6-users wrote: Yes, ** stands for exponentiation Thank you!

Re: sqrt and Buf question

2020-05-16 Thread William Michels via perl6-users
Hi Todd, Yes, ** stands for exponentiation. And exponentiation has higher precedence than multiplication. See below (I dropped a few zeros to help clarify): > put 2 * 10 ** 20 2 > put (2 * 10) ** 20 1048576 > put 2 * (10 ** 20) 2 > 20

Re: sqrt and Buf question

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-14 22:26, Peter Pentchev wrote: And what is `2 * 100 ** 2000 `? Is that `(2 x 100)^ 2000` ((2 times 100) to the 2000 power? Point 1: exponentiation has a higher priority than multiplication. Point 2:https://rosettacode.org/wiki/Integer_roots Any chance of you answering the

Re: sqrt and Buf question

2020-05-15 Thread ToddAndMargo via perl6-users
On 2020-05-15 12:09, Bruce Gray wrote: On May 14, 2020, at 4:36 PM, ToddAndMargo via perl6-users wrote: On 2020-05-14 08:13, Bruce Gray wrote: On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users wrote: Hi All, 1) how do I get 40 or more digits out of sqrt? —snip— Use an Integer

Re: sqrt and Buf question

2020-05-15 Thread Bruce Gray
> On May 14, 2020, at 4:36 PM, ToddAndMargo via perl6-users > wrote: > > On 2020-05-14 08:13, Bruce Gray wrote: >>> On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> 1) how do I get 40 or more digits out of sqrt? >> —snip— >> Use an Integer Root

Re: sqrt and Buf question

2020-05-14 Thread Peter Pentchev
On Thu, May 14, 2020 at 02:36:30PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-14 08:13, Bruce Gray wrote: > > > > > > > On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users > > > wrote: > > > > > > Hi All, > > > > > > 1) how do I get 40 or more digits out of sqrt? > > > >

Re: sqrt and Buf question

2020-05-14 Thread ToddAndMargo via perl6-users
On 2020-05-14 05:51, Tobias Boege wrote: On Thu, 14 May 2020, ToddAndMargo via perl6-users wrote: Hi All, 1) how do I get 40 or more digits out of sqrt? Meaningful digits? Not possible as sqrt uses limited precision. I think the IEEE 754 doubles that I would suspect to be used internally

Re: sqrt and Buf question

2020-05-14 Thread ToddAndMargo via perl6-users
On 2020-05-14 08:13, Bruce Gray wrote: On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users wrote: Hi All, 1) how do I get 40 or more digits out of sqrt? —snip— Use an Integer Root algorithm on ($number-you-want-the-root-of * 100 ** $number-of-digits-you-want), then shift the

Re: sqrt and Buf question

2020-05-14 Thread Bruce Gray
> On May 14, 2020, at 7:27 AM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > 1) how do I get 40 or more digits out of sqrt? —snip— Use an Integer Root algorithm on ($number-you-want-the-root-of * 100 ** $number-of-digits-you-want), then shift the decimal point of the result.

Re: sqrt and Buf question

2020-05-14 Thread ToddAndMargo via perl6-users
On 2020-05-14 05:51, Tobias Boege wrote: On Thu, 14 May 2020, ToddAndMargo via perl6-users wrote: Hi All, 1) how do I get 40 or more digits out of sqrt? Meaningful digits? In this instance, I do not care about meaningful. I only care about the noise. Just has to be repeatable. I may

Re: sqrt and Buf question

2020-05-14 Thread Tobias Boege
On Thu, 14 May 2020, ToddAndMargo via perl6-users wrote: > Hi All, > > 1) how do I get 40 or more digits out of sqrt? > Meaningful digits? Not possible as sqrt uses limited precision. I think the IEEE 754 doubles that I would suspect to be used internally are capped way below 40 significant

sqrt and Buf question

2020-05-14 Thread ToddAndMargo via perl6-users
Hi All, 1) how do I get 40 or more digits out of sqrt? 2) how to I assist those bytes to a 40 (or more) byte long Buf? This obviously does not work: my Num $x = 3.sqrt; my Buf $y = Buf.new($x) Type check failed in initializing element #0 to Buf; expected uint8 but got Num