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 definition of √. It's an approximation of the latter. Most computer languages except for CAS work this way. Truth by told, a lot of what I'm saying is general knowledge and shouldn't be news to anyone. Somewhat kiddingly, Raku should introduce the LazilyComputableReal datatype which returns True to maybe_irrational ... until it isn't. ;) On Thu, Feb 20, 2020 at 2:21 AM Shlomi Fish <shlo...@shlomifish.org> wrote: > Hi Paul, > > On Thu, 20 Feb 2020 00:22:34 -0500 > Paul Procacci <pproca...@gmail.com> 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 irrational....period. > > 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 . > -- __________________ :(){ :|:& };: