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:11
Subject:
Re: 'CALL-ME' Math problem?
Message ID:
52821062-200e-848b-2f74-a9854132b808@zoho.com
 >>
 >> 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:17 AM, Richard Hainsworth wrote:
> no operator between '5' & '('
> 
> That is mathematical shorthand.
> 
> Introducing such shorthand into a programming language leads to 
> ambiguities.
> 
> I'm not aware of any formal system that implies a '*' in such a situation.
> 
> Richard
> 
> On 02/03/2021 08:12, ToddAndMargo via perl6-users wrote:

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

:-)


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