[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Incorrect expression calculation between programming languages
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 6 Aug 2021 10:55:54 -0300
> Hello Luiz !
>
> Thank you for the link !
>
> But what still bugs me is the difference between heavily used programming
> languages:
>
> And after removing all modulo operations:
> ====
>
> EXPR = (((((((788)*(8.46))))+8342*1.803-1))*4186.4*(15))*(((22/((7530/((2)*(((((25))-421))))))*597)+7283.8-9.60+167))+(8871)
>
> [...]
We still have different semantics for "/" with integer operands (at
least). Changing both "/" to "//" puts Lua in the 77... category.
(But I don't know what creates the 85... category. Using both doubles
and long doubles, Lua gives compatible results for this expression.)
-- Roberto