Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialirem gürel
5,732 PointsMath
I think the professional preparing this video is unaware of mathematic laws..
2 Answers
irem gürel
5,732 PointsI mean the operands work like that in mathematics it is not the compiler's rule to take the multiplication and division operands prior to addition and subtraction. Thank you.
SivaKumar Kataru
2,386 PointsYes you are Right . Infact, Most of us haven't done evaluating a value of complex expressions in mathematics . When it comes to programming it is always the needy feature that programmer has to know it must .
Saud Alfaris
1,084 PointsWhat you are saying is true, however, Swift has the remainder operator which does not exist in the world of mathematics, so Swift needs its own rules.
Jason Anders
Treehouse Moderator 145,860 PointsActually Saud Alfaris, that is incorrect.
The modulo
operator is not just a function of Swift. It is used by almost every language and is a mathematical expression used in mathematics. You can read about it here if you wish. So, Swift is only following the rules of mathematics, not its own in this case.
Alexander Davison
65,469 PointsActually, the teacher is aware of the mathematical laws. What do you mean?
SivaKumar Kataru
2,386 PointsHe is Aware of the rules of mathematics .
SivaKumar Kataru
2,386 PointsSivaKumar Kataru
2,386 PointsNo, He is Correct with All Known mathematic Laws . This is how an expressions is evaluated in traditional mathematics . Off course it might seem odd to You , but this is the way that compilers follow the rules of mathematics in evaluating the expression based on the precedence Level of the arithmetic operators . Remember some operators in expressions may be evaluated Either from Left to right / right to Left . But Arithmetic Operators Always starts evaluating from left to right only .