lua-users home
lua-l archive

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

>> Please don't cry BUG when you see something you don't expect.

When a user gets behavoir that they did not expect, that most certainly
should be classified as a flaw.
As in this case, its a flaw in conveying the fact that math.mod and %
are different.

Instead of just saying "don't cry BUG"...maybe you should ask yourself
why the user expected a diferent behavoir...The answer is because common
sense tells him that they should have the same behavoir.  I certainly
would have assumed that math.mod and % had the same exact behavoir.
After reading the documentation, it's still not clear to me that they
would have diff behavoir.  I see different wording, but one definition
does not contain a formula where the other does.  For all I know, "a -
math.floor(a/b)*b" is the formula for "Returns the remainder of the
division of a by b".

If the documentation said:  "Please note that math.fmod() and % are not
functionally equivalent", or if both definitions had formulas then that
would solve this "flaw".  Perhaps the docs could also mention the part
about Lua mainly works with floats, so % has diff behavoir.

Bugs are not just defects in source code.

Being someone who writes software for software engineers, I totally
understand the frustration when people report things that are not bugs.
But my job is to make things easier for other software engineers, and if
they don't understand something, I need to make it easier for them, even
if its not a software defect.  

Reporting a "non-bug" to this list costs time (for a bunch of people).
Perhaps if the docs where more clear, that time could have been saved.