Question: Heres the C++ program /* * floating_pt_precision.cpp * * Created on: Sep 12, 2014 * Author: ian scott-fleming * * Value for PI below is

Heres the C++ program /* * floating_pt_precision.cpp * * Created on: Sep 12, 2014 * Author: ian scott-fleming * * Value for PI below is from http://3.141592653589793238462643383279502884197169399375105820974944592.com/ * * Starting program for demonstrating the precision of floating point data types. */ // to use C++11's math constants, such as M_PI, uncomment this line: //#define _USE_MATH_DEFINES // note that _USE_MATH_DEFINES must be #define'd BEFORE you #include// (actually, for visual studio, looks like it needs to be #included before ANY of the standard headers...) #include #include #include using namespace std; int main(void) { float f = 1.234; double d = 1.2345; long double ld = 1.23456; // cout Part 3: How big are the different integers on your system? Study, and then compile and run variablesizes.cpp, then answer the following questions (put your answers in a text file to turn in) How long are the various integer data types on your computer system, in bits and in bytes? (This will be a function of your processor and your operating system, and can be limited by your compiler). The sizeof(...) function tells you how many bytes there are in the thing passed to it char, unsigned char short, unsigned short int, unsigned int long, unsigned long long long float double long double What are the largest and smallest values you can store in each of the integer data types above? You'll need to calculate this from the sizes you get. You can check your answers using the windows or mac os x calculator; it will help to put it in "programmer" mode. (Recall that each byte has 8 bits, and with n bits, you can represent 2" different bit patterns, or values.) What are the ranges for the floating point types on your system (what do the exponents range from/to)? The program won't tell you that, but you can find the answers with a little googling (they should also be in my tutorial on floating point numbers). How many digits of precision are there for each type? The C++ header file climits (#include
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
