324-lecture16 - Principles of Programming Languages...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Principles of Programming Languages Principles of Programming Languages Lecture 16 Lecture 16 University of Toronto Wael Aboulsaadat Wael Aboulsaadat [email protected] [email protected] http://portal.utoronto.ca/ 1 Components of an Imperative Language Components of an Imperative Language • Data types • Variables, Operators, & Expressions • Assignment construct University of Toronto • Iteration construct • Branching construct • Function construct • Container construct 2 • A language designer must provide a specific set of data types. • Data types specification: – Name – Implementation – Operations Data types: introduction Data types: introduction University of Toronto – Exceptions/errors 3 • Primitive data types: – Mostly Supported by hardware – Examples: integer, float,… • Structured data types(SDT): – Constructed as aggregation of other primitive data types. Data types: classification Data types: classification University of Toronto – Either language defined data types or user defined data types 4 Data types: primitive Data types: primitive • Integer – Different sizes, hardware support – Examples: • Java: byte(8bit-signed), short(16-bit signed), int(32-bit signed),long(64-bit signed) – Implementation: • Most computers use twos complement • Floating-point University of Toronto – Difficult to represent by finite number of binary digits – Examples: • Java: float(32bit-IEEE754), double(64bit-IEEE754) – Implementation: • Most computers use IEEE754 5 Data types: primitive cont’d Data types: primitive cont’d • Decimal – Stores fixed number of decimal digits, with decimal point at a fixed position. – Restricted range but more precise than floats....
View Full Document

This document was uploaded on 08/02/2011.

Page1 / 20

324-lecture16 - Principles of Programming Languages...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online