lua-users home
lua-l archive

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


> Problem #2
> You are modifying the project, and you want the engineer
> from your team to understand math formulas in the code correctly.

Yes, this is one of the reasons.

But this mistake can also happen with just one person (engineer with good programming skills) transforming the formulas from one tool to another.
In particular if you are under pressure of time ("always").

Anyway, the rule "after / no * or / without ()" already proved to be useful in practice.

> Despite having newbie-friendly rules about parentheses,
> an engineer should better avoid writing code  :-)

I tend to disagree, but that will end up as a philosophical discussion and a matter of company culture.


> A possible solution is to write LaTeX-to-Lua converter
> latex_to_lua_func

Thank you - I did not know something like this exists.
Do you have a link to this project?

In this example LaTeX is not a source. I just added it in case the email list does not keep the monospace font, and the multi-line formula ends up unreadable.
Also, I'm not sure if LaTex is really well known and established outside Mathematics and Physics.


On Mon, Jan 11, 2021 at 3:13 AM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
So, instead of "a/b*c" you are writing "(a/b)*c".

AFAIU this rule should not be also applicable to the floor division,
because the symbol "//" is not used in math software for division.
For example, in Wolfram Mathematica "x//f" means postfix notation of "f[x]".