Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

Does it have correct contact information?

Answered: 1 week ago