COMP 110 Lecture Notes - Lecture 5: Type System

13 views7 pages
21 Aug 2020
School
Course

Document Summary

The equal to operator is =: two equals symbols side-by-side can be read as "is equal to?" 1 == 2 evaluates to false: important! Equality is very different from assignment: = is read as "is bound to a value of, == is read as "is equal to?, b = x == y. "the variable b is assigned the result of evaluating"is x equal to y?"" The not equal to operator is !: the ! symbol in many programming languages often means "not" 1 != 2 evaluates to true: b = x != y. "the variable b is assigned a value of evaluating"is x not equal to y?"" Logical type - bool: literal examples: true, false, a bool, short for boolean, can only be one of two values, either or false, the next lesson will focus on operators: Equality and relational precedence & types: these operators have lower precedence than arithmetic operators, thus:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents