On 2020-05-16 14:48, William Michels via perl6-users wrote:
Yes, ** stands for exponentiation
Thank you!
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 **
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 questio
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
> 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 g
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,
> &g
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
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
> 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 p
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
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
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
67 .
> >
> >
> >
> > I am glad perl6 supports complex numbers natively. What I am not glad
> > is that its definition of i does not agree with mathematics:
> >
> > % perl6
> >
> >> sqrt(-1+0i)
> > 6.12323399573677e-17+1i
> >
&g
>
>
> I am glad perl6 supports complex numbers natively. What I am not glad is that
> its definition of i does not agree with mathematics:
>
> % perl6
>
>> sqrt(-1+0i)
> 6.12323399573677e-17+1i
>
> Though (-1+0i)**0.5 != 1i for most other platforms, they
t; its definition of i does not agree with mathematics:
>
> % perl6
>
>> sqrt(-1+0i)
> 6.12323399573677e-17+1i
>
> Though (-1+0i)**0.5 != 1i for most other platforms, they still get
> sqrt(-1+0i) right:
>
> % python
>
> Python 2.7.10 (default, Oct 23 2015,
the patch below or just pull https://github.com/rakudo/rakudo/pull/667 .
I am glad perl6 supports complex numbers natively. What I am not glad is that
its definition of i does not agree with mathematics:
% perl6
> sqrt(-1+0i)
6.12323399573677e-17+1i
Though (-1+0i)**0.5 != 1i for most
its definition of i does not agree with mathematics:
% perl6
> sqrt(-1+0i)
6.12323399573677e-17+1i
Though (-1+0i)**0.5 != 1i for most other platforms, they still get sqrt(-1+0i)
right:
% python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.
At 10:29 PM -0400 4/27/04, Matt Fowles wrote:
All~
Perhaps it is just the mathematician in me speaking, but I think
that a sqrt op might be superfluous and could be replaced with exp
as sqrt(x) == exp(x,0.5). I cannot say anything about numerical
stability of precision, though, so feel free to
>>>>> "MF" == Matt Fowles <[EMAIL PROTECTED]> writes:
MF> Perhaps it is just the mathematician in me speaking, but I think that
MF> a sqrt op might be superfluous and could be replaced with exp as
MF> sqrt(x) == exp(x,0.5). I cannot say anything abou
On Tue, 2004-04-27 at 22:29, Matt Fowles wrote:
> All~
>
> Perhaps it is just the mathematician in me speaking, but I think that a
> sqrt op might be superfluous and could be replaced with exp as sqrt(x)
> == exp(x,0.5). I cannot say anything about numerical stability of
>
All~
Perhaps it is just the mathematician in me speaking, but I think that a
sqrt op might be superfluous and could be replaced with exp as sqrt(x)
== exp(x,0.5). I cannot say anything about numerical stability of
precision, though, so feel free to shoot me down.
Matt
Dan Sugalski wrote:
At 4
At 4:50 PM +0200 4/27/04, Stefan Lidman wrote:
>Everything is right, except... you forgot either the -c or -u switch
for the diff. (And no, I don't know why the default output from diffs
is mostly useless. Just one of those things, I expect)
ok resend with -u switch.
And it's in. Thanks!
--
@
goto NEXT();
}
+
+
+=item B(out NUM, in INT)
+
+=item B(out NUM, in NUM)
+
+Set $1 to the square root of $2.
+
+=cut
+
+inline op sqrt(out NUM, in INT) :base_core {
+ $1 = sqrt((FLOATVAL)$2);
+ goto NEXT();
+}
+
+inline op sqrt(out NUM, in NUM) :base_core {
+ $1 = sqrt((FLOATVAL)$2)
At 3:29 AM +0200 4/27/04, Stefan Lidman wrote:
This adds a square root op and fixes a typo. It is also my
first patch so I might have missed something, please tell
me what I did wrong.
Everything is right, except... you forgot either the -c or -u switch
for the diff. (And no, I don't know why the
/math.ops,v
retrieving revision 1.17
diff -r1.17 math.ops
853a854,873
>
>
> =item B(out NUM, in INT)
>
> =item B(out NUM, in NUM)
>
> Set $1 to the square root of $2.
>
> =cut
>
> inline op sqrt(out NUM, in INT) :base_
25 matches
Mail list logo