lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2021-08-06 15:09, Roberto Ierusalimschy wrote:
The difference between the 80... x 82... categories seems a precision
problem, though.

That difference is due to how each language rounds integer divisions
with negative operands.

More ammunition for the proponents of strong typing. As far as I am concerned % has type uint*uint->uint, unless you want to use it for polynomials or Gaussian integers or some other instance of a remainder theorem. The fastidious mathematician will deprecate the appearance even of negative integers in the neighbourhood of this symbol.

This

EXPR = (((((((788)*(8.46))))+8342*1.803-1))*4186.4*(15))*(((22/((7530/((2)*(((((25))-421))))))*597)+7283.8-9.60+167))+(8871)

reminded me of those blackboards filled with fake maths you tend to see in bad films in which mad scientists figure.