On 10/31/21 19:39, Sean McAfee wrote:
On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> wrote:
>> How do I get more digits out of sqrt?
On 10/31/21 17:50, Kevin Pye wrote:
> You don't.
>
> sqrt is a function which acts on 64-b
On Mon, Nov 1, 2021 at 2:38 AM Ralph Mellor wrote:
>
> `R` reverses associativity, which is *another* way that `R` is a
> nicely designed metaoperator, though this latter aspect is not
> relevant to why it worked for the solution you came up with?
Ah no. Of course it has to do the reversal or it
On Sun, Oct 31, 2021 at 6:10 PM Sean McAfee wrote:
>
> the main point of my message was about the R metaoperator and the
> associativity of the operator it creates.
OK. Fwiw this was something I didn't know, or had forgotten, and I
find it delightful.
The main point of *my* comment was that I d
On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> >> How do I get more digits out of sqrt?
>
> On 10/31/21 17:50, Kevin Pye wrote:
> > You don't.
> >
> > sqrt is a function which acts on 64-bit floating point numbers, and
> there's no more meaningful
How do I get more digits out of sqrt?
On 10/31/21 17:50, Kevin Pye wrote:
> You don't.
>
> sqrt is a function which acts on 64-bit floating point numbers, and
there's no more meaningful digits available. If you need more precision
you're on your own.
Dang! I was hoping ther was some th
You don't.
sqrt is a function which acts on 64-bit floating point numbers, and there's no
more meaningful digits available. If you need more precision you're on your own.
On Mon, 1 Nov 2021, at 11:20, ToddAndMargo via perl6-users wrote:
> On 10/31/21 16:42, ToddAndMargo via perl6-users wrote:
>>
On 10/31/21 16:42, ToddAndMargo via perl6-users wrote:
On 10/31/21 11:20, Sean McAfee wrote:
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users
mailto:perl6-us...@perl.org>> wrote:
put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
comb takes an argument that can save you
On 10/31/21 11:20, Sean McAfee wrote:
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users
mailto:perl6-us...@perl.org>> wrote:
put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
comb takes an argument that can save you a method call:
2.sqrt.comb.grep(*.Int)
==>
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users <
perl6-us...@perl.org> wrote:
> put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
>
comb takes an argument that can save you a method call:
2.sqrt.comb.grep(*.Int)
==>
2.sqrt.comb(/\d/)
On Sat, Oct 30, 2021 at 9:21 PM Wes Peng wrote:
> What's the "**" operator in perl? I most of the time use R for math, not
> familiar with this operation.
>
It's exponentiation: https://docs.raku.org/language/operators#infix_**
That wasn't a Raku expression I used it in, though, just my attempt
On Sat, Oct 30, 2021 at 9:03 PM Ralph Mellor
wrote:
> On Sat, Oct 30, 2021 at 8:38 PM Sean McAfee wrote:
> > Anyway, pretty cool!
>
> I agree it's cool, at least in a golfing sense.
>
> But is your explanation right?
>
> The *range* operator (`..`), if the rhs is less than the left,
> yields an
ToddAndMargo via perl6-users @ 2021-10-30 23:57 -07:
> Without going into why (it is a secret), how do I turn
>
>> my $x = sqrt 2
> 1.4142135623730951
>
> into an array of integers?
> @y[0] = 1
> @y[1] = 4
> @y[2] = 1
> @y[3] = 4
> @y[4] = 2
> @y[5] = 1
put 2.sqrt.comb.grep(*.Int)>>.Int[^10]
> On Oct 31, 2021, at 6:10 AM, ToddAndMargo via perl6-users
> wrote:
>
> On 10/31/21 01:43, Shlomi Fish wrote:
>
>>> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
>> (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1)
>
> Cool!
>
> my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
> [1 4 1 4 2 1 3 5
On Sun, Oct 31, 2021 at 10:10 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> On 10/31/21 01:43, Shlomi Fish wrote:
>
> >
> >> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
> > (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1)
>
> Cool!
>
> my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*
On 10/31/21 01:43, Shlomi Fish wrote:
("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
(1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1)
Cool!
my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
[1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1]
Is there a way to set how many digits I get?
Hi all!
On Sun, 31 Oct 2021 15:14:07 +0800
Alice wrote:
> Hello
>
> Try this one:
>
> use strict;
>
> use Data::Dumper;
>
>
> my $x = sqrt 2;
>
> my @li= grep{/\d+/} split//,$x;
>
>
> print Dumper \@li;
>
Or in raku:
> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
(1 4 1 4 2 1 3 5 6 2
Hello
Try this one:
use strict;
use Data::Dumper;
my $x = sqrt 2;
my @li= grep{/\d+/} split//,$x;
print Dumper \@li;
$ perl t1.pl
$VAR1 = [
'1',
'4',
'1',
'4',
'2',
'1',
'3',
'5',
'6',
17 matches
Mail list logo