Re: irrational nubmer?

2020-02-19 Thread Shlomi Fish
Hi Paul,

On Thu, 20 Feb 2020 00:22:34 -0500
Paul Procacci  wrote:

> If you wouldn't mind, please stop referring things as being "magical".
> There's nothing magical about Raku/Perl6 other than the devs that put in
> their time to give you that perception.
> They are to be commended for their time and effort.
> 
> Also, being condescending as in "he gave up" is uncalled for.
> 
> It's an IMPOSSIBILITY using today's technology to tell you whether a number
> is irrationalperiod.

Well, it is not unthinkable that a
https://en.wikipedia.org/wiki/Computer_algebra_system (CAS)-like system will be
able to tell that the abstract number sqrt(2) is irrational, as well as some
derivative numbers such as 3 + sqrt(2). E.g:

```
> my $num = sqrt(2);
> say $num.is_irrational()
True
```

It won't be able to give its exact value, but may still be able to reason about
it.

-- 

Shlomi Fish   https://www.shlomifish.org/
Perl Elems to Avoid - https://perl-begin.org/tutorials/bad-elements/

The cool thing about Vim is — you find something interesting with every typo.
— Su‐Shee on Freenode’s #perl .

Please reply to list if it's a mailing list post - http://shlom.in/reply .


Re: irrational nubmer?

2020-02-19 Thread Darren Duncan

Hello ToddAndMargo,

The answer to your question depends on how the number is represented.

If you are using a symbolic data type, meaning one that represents a number as a 
logical formula akin to program source code, and the operators on that data type 
work by manipulating tree expressions into other tree expressions, then you can 
easily represent an irrational number, and you can determine if a number is 
irrational, using mathematical proofs.  Eg, programming languages like Wolfram 
Mathematica or their ilk probably work in exactly this fashion.


Otherwise, if you are using a non-symbolic data type like typical integer or 
floating-point data types, then even if they support arbitrarily large 
precision, they still can only represent rationals, and the test for irrational 
is easy, the answer is always "not irrational" for these types.


All the numeric types built into Raku are non-symbolic, so the test is simply 
"false".


There probably are or probably can be symbolic numeric types, but they wouldn't 
be core.


-- Darren Duncan

On 2020-02-19 6:57 p.m., ToddAndMargo via perl6-users wrote:

Hi All,

This is a complete trivia question.

Is there a test to see if a number is irrational,
such as the square root of two?

And how does Int handle a irrational number?  Is
there a limit to magic Larry powder?

Many thanks,
-T



Re: irrational nubmer?

2020-02-19 Thread ToddAndMargo via perl6-users

On 2020-02-19 21:22, Paul Procacci wrote:

If you wouldn't mind, please stop referring things as being "magical".


That is not an insult.  I am using it as term of admiration.

And I did not dream it up myself.  I have had several of
the developers use both magical and Magic Larry powder
on me, which is where I got it from.

Plus it gets to the point instantly and is also a fun way
of stating that somethings is very technical and very
brilliantly executed.

It also tells me that when the explanation is way,
way over my head, to take it at face value.  AND
IN THREE WORDS!

There's nothing magical about Raku/Perl6 other than the devs that put in 
their time to give you that perception.


Of course not.  Raku can not break the laws of nature.


They are to be commended for their time and effort.


You mean admired for their work, which is the way I
mean it.  I am not sure where you got the opposite.
Maybe you are having a bad day?


Also, being condescending as in "he gave up" is uncalled for.


Oh no I am not.  I am teasing him.  I think the guy is
beyond brilliant.

It's an IMPOSSIBILITY using today's technology to tell you whether a 
number is irrationalperiod.


If ANYONE on the face of this earth can figure it out,
It would be Larry!  And I am not joking either!

Also, when it comes to Magic Larry Powder, never, never,
never ever say "IMPOSSIBLE".

-T


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: irrational nubmer?

2020-02-19 Thread Paul Procacci
If you wouldn't mind, please stop referring things as being "magical".
There's nothing magical about Raku/Perl6 other than the devs that put in
their time to give you that perception.
They are to be commended for their time and effort.

Also, being condescending as in "he gave up" is uncalled for.

It's an IMPOSSIBILITY using today's technology to tell you whether a number
is irrationalperiod.

The reason why a Raku/Perl6 Int can perform operations on numbers greater
than the cpu architecture allows
is because that single addition operator you use is actually more than just
a single addition.  You said you were
familiar with assembly language so let me give it to you that way.
Perhaps that will allow you to understand it better.

###
SECTION .data
mem: DQ 0
 DQ 0x7FFF

SECTION .text
add:
mov rax, qword [mem + 8]
add rax, 1
jno .ok
mov qword [mem + 8], 0
inc qword [mem]
.ok:
###

There's obviously more involved than this small snippet, but it shows how
storing values greater than 64-bits (in my case) is possible.
No magic needed, just a bit of comp-sci knowledge.  Obviously I'm leaving
out a display routine but that'd be for you to finish.  ;)
Also, the above is limited to a 128 bit value but with a proper allocator
the sky is the limit (unless you run out of memory).

Here's an experiment 

Write a program to tell you whether PI is irrational.
Respond once it returns with your answer.
A forewarning however, your response will fall on deaf ears as I'll be long
gone as will all others receiving this message.

On Wed, Feb 19, 2020 at 11:15 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> >> On Wed, Feb 19, 2020 at 9:58 PM ToddAndMargo via perl6-users
> >> mailto:perl6-users@perl.org>> wrote:
> >>
> >> Hi All,
> >>
> >> This is a complete trivia question.
> >>
> >> Is there a test to see if a number is irrational,
> >> such as the square root of two?
> >>
> >> And how does Int handle a irrational number?  Is
> >> there a limit to magic Larry powder?
> >>
> >> Many thanks,
> >> -T
> >
>
> On 2020-02-19 19:20, Paul Procacci wrote:
> >  >> Is there a test to see if a number is irrational
> > There is no such thing as an irrational number in computing.
> >
> > Surely there are "close approximations", but that's the best any
> > computer language can currently do.
> >
>
> Hi Paul,
>
> $ perl6 -e 'my num $x=sqrt(2); say $x;'
> 1.4142135623730951
>
> No Magic Larry "Num" that has no set length?
> And I thought Larry was unstoppable!  Guess
> he gave up at UInt and Int.
>
> :-)
>
> -T
>


-- 
__

:(){ :|:& };:


Re: irrational nubmer?

2020-02-19 Thread ToddAndMargo via perl6-users
On Wed, Feb 19, 2020 at 9:58 PM ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:


Hi All,

This is a complete trivia question.

Is there a test to see if a number is irrational,
such as the square root of two?

And how does Int handle a irrational number?  Is
there a limit to magic Larry powder?

Many thanks,
-T




On 2020-02-19 19:20, Paul Procacci wrote:

 >> Is there a test to see if a number is irrational
There is no such thing as an irrational number in computing.

Surely there are "close approximations", but that's the best any 
computer language can currently do.




Hi Paul,

$ perl6 -e 'my num $x=sqrt(2); say $x;'
1.4142135623730951

No Magic Larry "Num" that has no set length?
And I thought Larry was unstoppable!  Guess
he gave up at UInt and Int.

:-)

-T


Re: irrational nubmer?

2020-02-19 Thread Paul Procacci
 >> Is there a test to see if a number is irrational
There is no such thing as an irrational number in computing.

Surely there are "close approximations", but that's the best any computer
language can currently do.

On Wed, Feb 19, 2020 at 9:58 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> Hi All,
>
> This is a complete trivia question.
>
> Is there a test to see if a number is irrational,
> such as the square root of two?
>
> And how does Int handle a irrational number?  Is
> there a limit to magic Larry powder?
>
> Many thanks,
> -T
>


-- 
__

:(){ :|:& };:


irrational nubmer?

2020-02-19 Thread ToddAndMargo via perl6-users

Hi All,

This is a complete trivia question.

Is there a test to see if a number is irrational,
such as the square root of two?

And how does Int handle a irrational number?  Is
there a limit to magic Larry powder?

Many thanks,
-T


Re: Rakudo Star v2020.01

2020-02-19 Thread JJ Merelo
Great work, and thanks, Patrick.

El mié., 19 feb. 2020 a las 20:46, Patrick Spek via perl6-users (<
perl6-users@perl.org>) escribió:

> Hi everyone!
>
> Just now I've sent an announcement to perl6-compil...@perl.org, to
> notify people that I've made a first non-rc release of Rakudo Star. For
> those of you that use Rakudo Star, this may be a good time to try out
> the latest version! The files are available from https://dist.tyil.nl:
>
> - https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz
> - https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.asc
> -
> https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.checksums.txt
>
> I've not had many people to test things, but the rakudo spectest
> succeeds on all my machines, and I've been using it on my own machines
> for a couple weeks now, so I have no reason not to believe this release
> will work.
>
> Do note, however, that I only use, and therefore test, on GNU+Linux.
> This release does *not* contain a .msi (for Windows users) or a .dmg
> (for Mac users). If anyone would like to help out by building those
> files, please do not hesitate to reach out!
>
> If you have any questions on how to install this (on GNU+Linux or
> otherwise), please reply to the mailing list and I (or other people,
> especially for Windows and Mac users) will do my (or our) best to help
> you out.
>
> Any feedback on how to best communicate these releases is also very
> much appreciated.
>
> Lastly, I do not have access to the sources of https://rakudo.org/ (as
> far as I'm aware), and can therefore not update that website to mirror
> the release files, nor update its documentation. If anyone knows who to
> contact for this, please let me know.
>
> --
> With kind regards,
>
> Patrick Spek
>
>
> www:  https://www.tyil.nl/
> mail: p.s...@tyil.nl
> pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827
>
> social: https://soc.fglt.nl/tyil
> git:https://gitlab.com/tyil/
>


-- 
JJ


Rakudo Star v2020.01

2020-02-19 Thread Patrick Spek via perl6-users
Hi everyone!

Just now I've sent an announcement to perl6-compil...@perl.org, to
notify people that I've made a first non-rc release of Rakudo Star. For
those of you that use Rakudo Star, this may be a good time to try out
the latest version! The files are available from https://dist.tyil.nl:

- https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz
- https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.asc
- https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.checksums.txt

I've not had many people to test things, but the rakudo spectest
succeeds on all my machines, and I've been using it on my own machines
for a couple weeks now, so I have no reason not to believe this release
will work.

Do note, however, that I only use, and therefore test, on GNU+Linux.
This release does *not* contain a .msi (for Windows users) or a .dmg
(for Mac users). If anyone would like to help out by building those
files, please do not hesitate to reach out!

If you have any questions on how to install this (on GNU+Linux or
otherwise), please reply to the mailing list and I (or other people,
especially for Windows and Mac users) will do my (or our) best to help
you out.

Any feedback on how to best communicate these releases is also very
much appreciated.

Lastly, I do not have access to the sources of https://rakudo.org/ (as
far as I'm aware), and can therefore not update that website to mirror
the release files, nor update its documentation. If anyone knows who to
contact for this, please let me know.

-- 
With kind regards,

Patrick Spek


www:  https://www.tyil.nl/
mail: p.s...@tyil.nl
pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827

social: https://soc.fglt.nl/tyil
git:https://gitlab.com/tyil/


pgpDT6UUhBdGo.pgp
Description: OpenPGP digital signature