Math

Quickly reviewed mathematical functions, they’re pretty straight forward, but its good to keep a list. And MDAS (multiply *, divide /, addition +, subtraction , in order) applies… and for some reason I skipped this at school and went straight to brackets; so I occasionally get confused.

Then we have a single equal =, which assigns a variable to a name. And the double equals == which means equivalent; so that’s what we’ll use for the math stuff. Also, more than >, less than <, more than or equal to >=, less than or equal to <=, and not equivalent to !=. Notice the equal sign =, always comes second. 

It’s also possible to shorten code, for example, i = i + 1 becomes i++.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s