Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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, 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 f11.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 x = 2.3/1.5 y = 2.3/1.5 real :: x double precision :: 7,2 z = 2.300/1.500 ix x = 2.31.5 write(*,7) x = write(*,7) 'y = write(*,7) 2 = y = 2.3/1.5 z = 2.300 /1.500 7 format(A, f11.6) write(,7) 'X = write(+,7) y = write(*.7) = y 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 x 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 '% = 1.2345'? Is the 'do 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, 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 f11.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 x = 2.3/1.5 y = 2.3/1.5 real :: x double precision :: 7,2 z = 2.300/1.500 ix x = 2.31.5 write(*,7) x = write(*,7) 'y = write(*,7) 2 = y = 2.3/1.5 z = 2.300 /1.500 7 format(A, f11.6) write(,7) 'X = write(+,7) y = write(*.7) = y 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 x 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 '% = 1.2345'? Is the 'do thing a thing on your compiler? Results are compiler dependent, so say what compiler and operating system you are using

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

Construction Guide Accounting And Knowledge Based Audits

Authors: CPA Eric P. Wallace

1st Edition

0808020870, 978-0808020875

More Books

Students also viewed these Accounting questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago