3. Depending on the defaults set for your compiler some care needs be taken dealing with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Depending on the defaults set for your compiler some care needs be taken dealing with ascii strings like 1.2; to illustrate this run this program real :: x double precision :: y, z x = 2.3/1.5 y= 2.3/1.5 z = 2.3d0/1.5d0 write (*,7) ³x = write (*,7) 'y = write (*,7) 'z = ¹₂x y ,2 7 format (A, f11.6) end The exact value of 2.3/1.5 is 1.53333 with the digit three repeating. The A in the format statement allows for printing literal strings like 'x=' while the fl1.6 is floating point format with 11 spaces set aside with six after the decimal point. This emulates the behavior of some compilers that default to printing only six digits after the decimal place. Compare x and y, also compare y and z. Next run this program real :: x double precision y,z x 2.3/1.5 y = 2.3/1.5 z 2.3d0/1.5d0 write (7) ¹x = write (7) ³y = write (,7) ¹2 = 7 format (A, f18.15) end This corresponds to printing out the number of digits that corresponds (on most systems) to double precision. Of course for x the digits after the seventh or eights mean nothing. Compare and y. Comment on any odd behavior. Compare y and z. Comment. If your program is supposed to be all double precision floating point is it ok to say something like 'z = 1.2345'? Is the 'd0' thing a thing on your compiler? Results are compiler dependent, so say what compiler and operating system you are using. 3. Depending on the defaults set for your compiler some care needs be taken dealing with ascii strings like 1.2; to illustrate this run this program real :: x double precision :: y, z x = 2.3/1.5 y= 2.3/1.5 z = 2.3d0/1.5d0 write (*,7) ³x = write (*,7) 'y = write (*,7) 'z = ¹₂x y ,2 7 format (A, f11.6) end The exact value of 2.3/1.5 is 1.53333 with the digit three repeating. The A in the format statement allows for printing literal strings like 'x=' while the fl1.6 is floating point format with 11 spaces set aside with six after the decimal point. This emulates the behavior of some compilers that default to printing only six digits after the decimal place. Compare x and y, also compare y and z. Next run this program real :: x double precision y,z x 2.3/1.5 y = 2.3/1.5 z 2.3d0/1.5d0 write (7) ¹x = write (7) ³y = write (,7) ¹2 = 7 format (A, f18.15) end This corresponds to printing out the number of digits that corresponds (on most systems) to double precision. Of course for x the digits after the seventh or eights mean nothing. Compare and y. Comment on any odd behavior. Compare y and z. Comment. If your program is supposed to be all double precision floating point is it ok to say something like 'z = 1.2345'? Is the 'd0' thing a thing on your compiler? Results are compiler dependent, so say what compiler and operating system you are using.
Expert Answer:
Answer rating: 100% (QA)
I ran the two programs you provided using the Intel Fortran Compiler 202310223 on a Linux system Program 1 Outputx 1533330y 153333z 1533333x y Truey z ... View the full answer
Related Book For
Human Resource Management
ISBN: 978-0538453158
13th Edition
Authors: Robert L. Mathis, John H. Jackson
Posted Date:
Students also viewed these accounting questions
-
Do Gauss-Jordan reduction (a) x + y - z = 3 2x - y - z = 1 3x + y + 2z = 0 (b) x + y + 2z = 0 2x - y + z = 1 4x + y + 5z = 1
-
x + y + z = 5 x + y - 4z = 10 - 4x + y + z = 0 Solve the system by inverting the coefficient matrix and using Theorem 1.6.2.
-
Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. For example, if the user enters 97, the program displays the character a. Here is a sample run:...
-
You have been provided the following data about the securities of three firms, the market portfolio, and the riskfree asset: a. Fill in the missing values in the table. b. Is the stock of Firm A...
-
A division budgeted an operating profit of $3,000 on sales of $8,000 and costs of $5,000. However, at the beginning of the period one of the divisions machines broke down and could not be fixed until...
-
What happens when the data you use to monitor progress, indicate that change is not happening or that the outcomes will not be met? (This response does not have to be related to your issue/action...
-
Explain why introducing predators can help in systems that use artificial evolutionary techniques.
-
James Streets son, Harold, is 10 years old today. Harold, a studious young fellow, is already making plans to go to college on his 18th birthday, and his father wants to start putting money away now...
-
The picture shows six different situations of a box with one or two horizontal forces applied. The mass of each box is given, and the strength of each force is specified in terms of F. In each case...
-
Daniel Merrill is the manager of an airport gift shop, Merrill News and Gifts. From the following data, Mr. Merrill wants a cash budget showing expected cash receipts and disbursements for the month...
-
A company pays a constant annual dividend of $1.18 per share. How much are you willing to pay for one share if you require a 15 percent rate of return?
-
You have been asked to consult for an entrepreneur who is assembling investors for a new professional sport league. A critical decision for the league will be whether to organize under a...
-
A share of New Fangled Sports stock is expected to provide a \($1\) per year dividend payment the first year and to grow at 8% thereafter. With a discount rate of 12% and a 15-year horizon, what is...
-
Project M has a cost of \($65,125,\) expected net cash inflows of \($13,000\) per year for ten years, and a cost of capital of 11%. What is the projects payback period (to the closest year)?
-
In a discounted cash flow analysis, what happens to the NPV if, all else being equal, the discount rate goes up? What happens to the NPV if the growth rate for the terminal value (perpetual growth...
-
In measuring the economic impact of a sport team, is it correct to count both the spending by fans inside the stadium and the spending by the team (in running its operations) in the community?
-
1-A block, M = 2.5 kg is pulled a distance, d = 2 m on a rough horizontal surface by a constant force, F = 20 N acting at an angle of 37 as shown in the figure. A constant friction force, f= 6 N acts...
-
1) Predict the organicproduct formed when BzCl reacts with cyclohexanol. BzCl = benzoylchloride. 2) Provide the majororganic product of the reaction below. 3) Draw the structureof the product formed...
-
You have recently assumed the role of HR Manager in your company. In reviewing the company records, you note that the job descriptions were last updated 5 years ago. The Company President has taken...
-
Your insurance company needs to update the sales incentive program for its sales/marketing representatives. Due to growth in the volume and diversity of the products being sold, the existing system...
-
Assume you are going to look for a current job of interest to you. Utilize broad websites such as www.Job.com, Yahoo! HotJobs, Monster, Taleo, and others to learn about job possibilities for yourself.
-
For each of the following sets of numbers, calculate a \(95 \%\) confidence interval for the mean ( \(\sigma\) known); before going through the steps in calculating the confidence interval, the...
-
Consider a 3 -year \(10 \%\) coupon bond. The underlying short rate of interest follows a lattice with initial value of \(R=1.15\) and then has an factor of 1.02 , a down factor of .99 , and...
-
Using the density function of the stopping time probability for a fixed \(\lambda\), find the average time to the first event over the entire interval \([0, \infty)\).
Study smarter with the SolutionInn App