Exact arithmetic, MATLAB Programming

Run the MATLAB script
sum = single(0); term = single(1);
n=1;
while sum + term > sum
sum = sum+term;
n=n+1;
term = 1/n;
end
n

Explain what you think it is trying to do. What would this code do in exact arithmetic?Describe why the code produces a nite result and (harder) describe the output. What would happen (don't try it!) if you replaced the fi rst line with sum=0; term=1;?

Posted Date: 3/22/2013 7:03:16 AM | Location : United States







Related Discussions:- Exact arithmetic, Assignment Help, Ask Question on Exact arithmetic, Get Answer, Expert's Help, Exact arithmetic Discussions

Write discussion on Exact arithmetic
Your posts are moderated
Related Questions
This assignment is motivated by the use of flybys of planets / moons in spacecraft missions to alter a spacecraft's trajectory (flight path). Planetary flybys can be used to not on

How to Start Working withSimpower: 1. In the Simulink screen, open a new "Model" (File àNewà Model), name it and save it. 2. Expand the SimPowerSystems library, select and

Consider the shaft-rotor system shown in Figure. Write down the equations of motion. Taking  I= 1 kgm 2 and k=10 kNm/rad, for two special cases (α =0.5 and α = 1000) find as many

ACTIVITIES OF A PROJECT 1-2 1-3 1-4 1-5 2-6 3-6 3-7 4-7 5-7 7-6 6-8 7-8 THE COMMPANY LOSES 2,000 FOR EVERY WEEK THE PROJECT LASTS BEYOND 30 WEEKS. fOR EACH OF THE PROPOSALS; ACTIVI

how to wriet program for batch reactor

Use MATLAB and a method based on linear predictive coding for the restoration of a clipped voiced speech signal. My proposed algorithm is based on linear prediction where a reco

Temperature readings were done every hour (starting at 1 P.M., but the end time could vary) and stored in a vector called readings. Write a function called halffit that receives th

Mathematical operation: For numerical operands, the use of such operators is clear-cut. For illustration, 3 >> 3 ans = 1 >> 9 ans = 0 Though, in the Wo

Create a GUI that has A button to bring up a dialog to select a text file and read it in. Plot the x,y values on the GUI Have text entry values, one for each parameter, in which

A file houseafford.dat stores on its three lines years, median incomes and median home prices for a city. The dollar amounts are in thousands. For example, it might look like this: