What does the term “BODMAS” mean?

2020-02-11 18:45发布

What is BODMAS and why is it useful in programming?

标签: math
7条回答
女痞
2楼-- · 2020-02-11 19:17

I'm not really sure how applicable to programming the old BODMAS mnemonic is anyways. There is no guarantee on order of operations between languages, and while many keep the standard operations in that order, not all do. And then there are some languages where order of operations isn't really all that meaningful (Lisp dialects, for example). In a way, you're probably better off for programming if you forget the standard order and either use parentheses for everything(eg (a*b) + c) or specifically learn the order for each language you work in.

查看更多
登录 后发表回答