class10 - Representing and Manipulating Information CS 47...

Info iconThis preview shows pages 1–5. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Representing and Manipulating Information CS 47 Natasha Khuri March 4 HW 6 is due 3/9/2010 PP1 is due 3/11/2010: Group work: individual work will not be accepted Ignore any reference to dlc dlc dlc dlc CS 47 Natasha Khuri Lecture 9: Slide Correction Slide #33 should read: Subtle features of unsigned arithmetic, and especially the implicit conversion of signed to unsigned, can lead to errors and vulnerabilities. One way to avoid such bugs is to never use unsigned numbers: Java only supports signed integers and requires that they are implemented with twos complement arithmetic. The right shift performs an arithmetic shift CS 47 Natasha Khuri Puzzles Assume machine with 32 bit word size, twos complement integers For each of the following C expressions, either: Argue that is true for all argument values Give example where not true x < 0 x < 0 x < 0 x < 0 ((x*2) < 0) ((x*2) < 0) ((x*2) < 0) ((x*2) < 0) ux ux ux ux >= 0 >= 0 >= 0 >= 0 int x = foo(); int y = bar(); unsigned ux = x; unsigned uy = y; CS 47 Natasha Khuri...
View Full Document

Page1 / 9

class10 - Representing and Manipulating Information CS 47...

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

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