[SOLVED] E0251: Programming Assignment 1

30.00 $

Category: Tags: , , ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Assignment-1-5se49t.zip (102.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Data Representation

1. Consider these two float approximations for the value of π – (i) 22/7, (ii) 0x40490FDB. In which binary position do they begin to differ? In which decimal position do they begin to differ?

2. Assuming that real data is represented using IEEE single (double) precision floating point  representation, calculate and explain how many times this C while loop will iterate. Verify  your answer experimentally.

float f=1.0; while (f != 0.0) f = f / 2.0;

3. Consider the real valued sum of the harmonic sequence ∑

n

i=1

1 /i

. Write C functions that

compute the float value by iterating (i) forwards (from i=1 upto i=n), and (ii) backwards  (from i=n downto i=1). Observe that the sum depends on the order of summation (i.e.,  backward vs forward) for some values of n? Explain why this happens.

Submit an archive file (.zip or .tar) containing (1) a pdf file of your brief answers, and (2) the  C programs that you wrote to arrive at the answers.

 

  • Assignment-1-5se49t.zip