develooper Front page | perl.perl6.users | Postings from July 2020

Re: root cubic

Thread Previous | Thread Next
From:
Richard Hainsworth
Date:
July 9, 2020 15:43
Subject:
Re: root cubic
Message ID:
cd7c363d-81f3-7280-6f3d-01681bcf5173@gmail.com
Did you mean the square root of 9 to give 3. Maybe you were wanting cube 
root of 27?

Using REPL, I got

 > say 27**(1/3)
3
 >

On 09/07/2020 16:26, Aureliano Guedes wrote:
> Hi all,
>
> A quick question.
>
> This is expected?
>
>     raku -e 'say 9 ** (1/3)'
>     2.080083823051904
>
>
> Why do I'm asking this?
> I know about the computational floating problem and I also know that 
> the Raku deal with rational whenever it is possible and store numbers 
> as expressions (actually I don't know if there are more details). 
> That's why 0.2 + 0.1 == 0.3 in Raku returns True whilst in other 
> languages like Python, Perl5, and Ruby return False.
>
> Then, I was just playing around and I'd like to check if it is expected.
>
> Thanks
>
>
> -- 
> Aureliano Guedes
> skype: aureliano.guedes
> contato:  (11) 94292-6110
> whatsapp +5511942926110

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About