develooper Front page | perl.perl6.users | Postings from March 2021

Re: 'CALL-ME' Math problem?

Thread Previous | Thread Next
From:
ToddAndMargo via perl6-users
Date:
March 2, 2021 09:10
Subject:
Re: 'CALL-ME' Math problem?
Message ID:
d71bde6f-19f3-847b-b7be-dedaba7d1189@zoho.com
>> On Tue, 2 Mar 2021, 08:13 ToddAndMargo via perl6-users, 
>> <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
>> 
>> 
>>     Hi All,
>> 
>>     Math problem:
>>           x = 60÷5(7−5)
>> 
>>     raku -e 'say 60÷5(7−5)'
>>     No such method 'CALL-ME' for invocant of type 'Int'
>>         in block <unit> at -e line 1
>> 
>>     Seems raku does not like the ().  How do I fix this
>>     and maintain the flow and look of the equation?
>> 
>>     -T
>> 
>>     The correct answer is 24
>> 

On 3/2/21 12:16 AM, Simon Proctor wrote:
> You need to put in the multiplication sign.
> 

Hi Simon and Richard,

Now I feel dumb!

$ raku -e 'say 60÷5*(7−5)'
24

Thank you!

The formula is an example of left to right precedence.

-T


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