Is it right that compiler also follow the BODMAS rule? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Is it right that compiler also follow the BODMAS rule?

18th May 2020, 11:53 AM
Saurabh
Saurabh - avatar
6 Réponses
+ 3
From a design perspective, it's better to follow the said BODMAS rule because people are more used to it. Another reason is that it's the foundation of mathematics.
18th May 2020, 2:42 PM
lu Āi
+ 2
ūĚźäūĚźĘūĚźĘūĚźõūĚź® ūĚźÜūĚź°ūĚźöūĚź≤ūĚźöūĚź• OP asked if it is alright for a compiler to follow the BODMAS rule.
18th May 2020, 2:45 PM
lu Āi
+ 2
ūĚźäūĚźĘūĚźĘūĚźõūĚź® ūĚźÜūĚź°ūĚźöūĚź≤ūĚźöūĚź• OP = Original Poster or something along those lines. What I was saying is that the reason most programming languages follow the said BODMAS rule is because people are more used to it, the precedence and associativity of the operations. Another reason is that BODMAS is one of the foundation of mathematics.
18th May 2020, 2:51 PM
lu Āi
+ 2
Hahha seems like everyone got their points. OP and LP (LOCAL POSTER) ūüėā
18th May 2020, 2:55 PM
Saurabh
Saurabh - avatar
+ 1
Ok and what does elif means?
18th May 2020, 12:00 PM
Saurabh
Saurabh - avatar
+ 1
Yes because everywhere is BODMAS rules are applying whatever that is Maths or programming we can use BODMAS
18th May 2020, 2:50 PM
Saurabh
Saurabh - avatar