# Class 14: Operators and Precedence

Back to IEEE Floating Point Representation. On to Pause for Breath.

This outline is also available in PDF.

Held: Monday, 20 September 2010

Summary: We consider a variety of C's important operators.

Related Pages:

• EBoard.

Notes:

• Warning: Your class mentor will be unavailable on Tuesday and Wednesday this week.
• Don't forget the Town Hall meetings today!
• Reminder: Review session Friday!
• Are there questions on Assignment 4? I know that some of you have questions about stacks.

Overview:

• IEEE Floating Point, Continued.
• C's Wealth of Operators.
• Some Precedence and Other Examples.
• Group Exercise.

## IEEE Floating Point Numbers, Revisited

• We'll wrap up our discussion of IEEE floating point numbers.

## Operations in C

• A wide variety.
• Basic binary math: +, -, *, /, %
• Basic unary math: +, -
• Increment/decrement operators: ++, --
• Logical operators !, ||, &&
• Comparison operators: <, <=, >, >=, ==, !=
• Binary bitwise operators: &, |, <<, >>
• Assignment operators: =, +=, -=, *=, /=, %amp;=, &=, ^=, |=, <<=, >>=
• And more!

## Group Exercise: Precedence

• As a group, write a series of programs that help us determine the precedence order of the various operations.
• That is, your programs will consist of expressions that have different values in different precedence orders.
• Your goal is to cover as many operations as possible.

Back to IEEE Floating Point Representation. On to Pause for Breath.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Wed Dec 8 10:57:06 2010.
The source to the document was last modified on Fri Aug 13 15:41:46 2010.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2010F/Outlines/outline.14.html`.

Samuel A. Rebelsky, rebelsky@grinnell.edu