Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and
2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and cents). Calculate the roundoff error for two different rounding strate- gies. Hint: in C/C+ use function floorf, roundf and ceilf for different roundoff strategies 2b) Generalize your roundoff function from above (instead of 2 use n) and use it to solve the following system of simultaneous equations using different number of significant digits such that x and y should 0.10362 + 0.2 122y = 0.7381 0.2081 r + 04247y = 0.9327 Compare the roundoff errors for the two different strategies used and comment on your results 2a) You are to write a rounding function for a financial app that rounds off real numbers to have only 2 decimal places (dollars and cents). Calculate the roundoff error for two different rounding strate- gies. Hint: in C/C+ use function floorf, roundf and ceilf for different roundoff strategies 2b) Generalize your roundoff function from above (instead of 2 use n) and use it to solve the following system of simultaneous equations using different number of significant digits such that x and y should 0.10362 + 0.2 122y = 0.7381 0.2081 r + 04247y = 0.9327 Compare the roundoff errors for the two different strategies used and comment on your results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started