ECEn 324 Homework Set #2

Submit your (hardcopy) solutions to the problems below in the homework box before 4:45 PM on the assigned date.

Clarifications

You should write code, test it with multiple values, and submit sample output for each of the three problems. (Your submission need not be voluminous: it is sufficient to include output for a few of your test cases.)

Problem 2.56: Note that the only code you modify is the expression in the return value. Your code can include numbers (small constants) as well as references to variables ux, uy, sx, and sy. Hint: There are four cases to consider.

Here is sample code for f2u():

 
unsigned f2u(float f) 
{ 
    return *((unsigned *) &f); 
}


Last updated 4 January 2010