Re: irrational nubmer?

2020-03-11 Thread Todd Chester via perl6-users
On 2020-03-11 01:23, Todd Chester via perl6-users wrote: On 2020-03-10 22:55, Shlomi Fish wrote: Speaking of trivia, and off topic, did you know that √2 caused a major religious upheaval when the result of a 1,1,√2 triangle came out?  The poor Pythagoreans: all numbers had to be rational. 

Re: irrational nubmer?

2020-03-11 Thread Todd Chester via perl6-users
On 2020-03-10 22:55, Shlomi Fish wrote: Speaking of trivia, and off topic, did you know that √2 caused a major religious upheaval when the result of a 1,1,√2 triangle came out? The poor Pythagoreans: all numbers had to be rational. Hippasus even got murdered for blowing the whistle on √2.

Re: irrational nubmer?

2020-03-11 Thread Shlomi Fish
Hi Todd! On Wed, 26 Feb 2020 12:32:57 -0800 ToddAndMargo via perl6-users wrote: > On 2020-02-26 12:14, Tobias Boege wrote: > > On Wed, 26 Feb 2020, ToddAndMargo via perl6-users wrote: > $ p6 'say (99/70).base-repeating();' > (1.4 142857) > > means that 142857 also repeats

Re: irrational nubmer?

2020-02-26 Thread ToddAndMargo via perl6-users
On 2020-02-26 12:14, Tobias Boege wrote: On Wed, 26 Feb 2020, ToddAndMargo via perl6-users wrote: $ p6 'say (99/70).base-repeating();' (1.4 142857) means that 142857 also repeats (it does not), but that it is best it can figure out with the precision it has? What are you talking about? It

Re: irrational nubmer?

2020-02-26 Thread ToddAndMargo via perl6-users
On 2020-02-26 12:21, William Michels via perl6-users wrote: This code below seems to accurately return the number of "repeating digits" (576) using Perl6 alone: mbook: homedir$ perl6 -e 'say

Re: irrational nubmer?

2020-02-26 Thread William Michels via perl6-users
This code below seems to accurately return the number of "repeating digits" (576) using Perl6 alone: mbook: homedir$ perl6 -e 'say

Re: irrational nubmer?

2020-02-26 Thread Tobias Boege
On Wed, 26 Feb 2020, ToddAndMargo via perl6-users wrote: > > > $ p6 'say (99/70).base-repeating();' > > > (1.4 142857) > > > > > > means that 142857 also repeats (it does not), but > > > that it is best it can figure out with the precision > > > it has? > > > > > > > What are you talking about?

Re: irrational nubmer?

2020-02-26 Thread ToddAndMargo via perl6-users
On 2020-02-26 11:34, Peter Scott wrote: On 2/26/2020 11:14 AM, ToddAndMargo via perl6-users wrote: I used gnome calculator to 20 digits:     665857/470832     1.41421356237468991063 Sorry.  Not seeing any repeating patterns. Here is NAS doing it to 1 million digits (they have too much time on

Re: irrational nubmer?

2020-02-26 Thread Peter Scott
On 2/26/2020 11:14 AM, ToddAndMargo via perl6-users wrote: I used gnome calculator to 20 digits:     665857/470832     1.41421356237468991063 Sorry.  Not seeing any repeating patterns. Here is NAS doing it to 1 million digits (they have too much time on their hands):

Re: irrational nubmer?

2020-02-26 Thread ToddAndMargo via perl6-users
On 2020-02-26 08:20, Tobias Boege wrote: On Wed, 26 Feb 2020, Todd Chester via perl6-users wrote: Hi Tobias, I am confused as to as to what you mean by numerator and denominator. Rational numbers can always be written as the ratio of two integers: a/b with b non-zero. One calls a the

Re: irrational nubmer?

2020-02-26 Thread Tobias Boege
On Wed, 26 Feb 2020, Todd Chester via perl6-users wrote: > Hi Tobias, > > I am confused as to as to what you mean by numerator and > denominator. > Rational numbers can always be written as the ratio of two integers: a/b with b non-zero. One calls a the numerator and b the denominator. In Raku

Re: irrational nubmer?

2020-02-26 Thread Todd Chester via perl6-users
On 2020-02-20 22:32, Tobias Boege wrote: On Thu, 20 Feb 2020, ToddAndMargo via perl6-users wrote: On Fri, 21 Feb 2020 at 13:31, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: $ perl6 -e 'say sqrt(2).base-repeating();' No such method 'base-repeating' for invocant

Re: irrational nubmer?

2020-02-26 Thread Todd Chester via perl6-users
On 2020-02-23 03:07, Shlomi Fish wrote: Hi, just for the record - I was not talking about Raku, just about a hypothetical language with CAS-like capabilities (see https://en.wikipedia.org/wiki/Computer_algebra_system ) that would be able to do it. I was just using Raku-like syntax for

Re: irrational nubmer?

2020-02-23 Thread Shlomi Fish
On Thu, 20 Feb 2020 16:27:27 -0800 William Michels wrote: > On Thu, Feb 20, 2020 at 2:25 PM ToddAndMargo via perl6-users > wrote: > > > > On 2020-02-19 23:21, Shlomi Fish wrote: > > > Hi Paul, > > > > > > > > Well, it is not unthinkable that a > > >

Re: irrational nubmer?

2020-02-22 Thread ToddAndMargo via perl6-users
On 2020-02-22 01:58, Darren Duncan wrote: What would the practical value of that be? None that I know of. Did you miss the "complete trivia question" part in my original question.

Re: irrational nubmer?

2020-02-22 Thread Darren Duncan
On 2020-02-20 2:22 p.m., ToddAndMargo via perl6-users wrote: On 2020-02-20 00:41, Darren Duncan wrote: On 2020-02-20 12:10 a.m., Tobias Boege wrote: Granted, Todd would not have anticipated this answer if he calls arbitrary length integers "magic powder" and the question "I have computed this

Re: irrational nubmer?

2020-02-20 Thread Tobias Boege
On Thu, 20 Feb 2020, ToddAndMargo via perl6-users wrote: > > > On Fri, 21 Feb 2020 at 13:31, ToddAndMargo via perl6-users > > > mailto:perl6-users@perl.org>> wrote: > > > > > > $ perl6 -e 'say sqrt(2).base-repeating();' > > > No such method 'base-repeating' for invocant of type 'Num' > >

Re: irrational nubmer?

2020-02-20 Thread ToddAndMargo via perl6-users
On Fri, 21 Feb 2020 at 13:31, ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: $ perl6 -e 'say sqrt(2).base-repeating();' No such method 'base-repeating' for invocant of type 'Num' in block at -e line 1 On 2020-02-20 19:07, Norman Gaywood wrote: perl6 -e

Re: irrational nubmer?

2020-02-20 Thread Norman Gaywood
On Fri, 21 Feb 2020 at 13:31, ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > $ perl6 -e 'say sqrt(2).base-repeating();' > No such method 'base-repeating' for invocant of type 'Num' >in block at -e line 1 > perl6 -e 'say sqrt(2).Rat.base-repeating();' (1.4

Re: irrational nubmer?

2020-02-20 Thread ToddAndMargo via perl6-users
On 2020-02-20 16:27, William Michels via perl6-users wrote: mbook:~ homedir$ perl6 -e 'say (1/7).base-repeating();' (0. 142857) mbook:~ homedir$ perl6 -e 'say (1/7).base-repeating(10);' (0. 142857) mbook:~ homedir$ perl6 -e 'say (1/7).base-repeating(10).perl;' ("0.", "142857") mbook:~ homedir$

Re: irrational nubmer?

2020-02-20 Thread William Michels via perl6-users
On Thu, Feb 20, 2020 at 2:25 PM ToddAndMargo via perl6-users wrote: > > On 2020-02-19 23:21, Shlomi Fish wrote: > > Hi Paul, > > > > > 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

Re: irrational nubmer?

2020-02-20 Thread ToddAndMargo via perl6-users
On 2020-02-19 23:21, Shlomi Fish wrote: Hi Paul, 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: Hi

Re: irrational nubmer?

2020-02-20 Thread ToddAndMargo via perl6-users
On 2020-02-20 00:41, Darren Duncan wrote: On 2020-02-20 12:10 a.m., Tobias Boege wrote: Granted, Todd would not have anticipated this answer if he calls arbitrary length integers "magic powder" and the question "I have computed this Int/Num/Rat in Raku, is it rational?" does indeed not make any

Re: Rational numbers... was Re: irrational nubmer?

2020-02-20 Thread ToddAndMargo via perl6-users
On 2020-02-20 05:53, Richard Hainsworth wrote: However, my question to you is: when would you come across an irrational number in a computer? How would you express it? Suppose I gave you a function  sub irrational( $x ) which returns true for an irrational number. What would you put in for $x?

Re: irrational nubmer?

2020-02-20 Thread Paul Procacci
Every system that uses a fixed finite number of bits to represent numbers has to represent them as implicit rationals...that is unless it goes through the trouble of having a finite list of irrational constants that it represented specially. sqrt is not equivalent to the mathematical

Rational numbers... was Re: irrational nubmer?

2020-02-20 Thread Richard Hainsworth
Hi Todd, This is going to be hard for an intuitive guy like you, but it can be proven that 100% of all numbers are irrational (see https://math.stackexchange.com/questions/1556670/100-of-the-real-numbers-between-0-and-1-are-irrational ). Except the ones that a computer can do operations on,

Re: irrational nubmer?

2020-02-20 Thread Darren Duncan
On 2020-02-20 12:10 a.m., Tobias Boege wrote: Granted, Todd would not have anticipated this answer if he calls arbitrary length integers "magic powder" and the question "I have computed this Int/Num/Rat in Raku, is it rational?" does indeed not make any sense. But there are computer languages

Re: irrational nubmer?

2020-02-20 Thread Tobias Boege
On Wed, 19 Feb 2020, 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. > It all depends on

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

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

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,

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.

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

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 <

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