Answered step by step
Verified Expert Solution
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
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
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