Would like to print out max digits for a variable (data type double). For example,
double d1 = 100.01234567890123456789012345678901234567890123456789
double d2 = 2.0
How to print out d1/d2, which still keeps exact answer?
d1 = 1.0; d2 = 3.0
How to print out the digits of d1/d2 as many as possible for this data type?
double has a precision of 15 or 16 significant decimal digits. significant means it is regardless where the decimal point is. you can test that by printing the d1 of your first sample. you will see that
Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
Iteration is repetition of a process. A student who goes to school repeats the process of going to school everyday until graduation. We go to grocery store at least once or twice a month to buy products. We repeat this process every mont…