However, in most cases, float and double seem to be interchangeable, i.e Using one or the other does not seem to affec. From what i have read, a value of data type double has an approximate precision of 15 decimal places However, when i use a number whose decimal representation repeats, such as 1.0/7.0, i find tha. When should i use double instead of decimal Has some similar and more in depth answers
The double not in this case is quite simple It is simply two not s back to back The first one simply inverts the truthy or falsy value, resulting in an actual boolean type, and then the second one inverts it back again to its original state, but now in an actual boolean value That way you have consistency: Double d = ((double) num) / denom But is there another way to get the correct double result
Using long double i get 18/19 = 0.947368421052631578., and 947368421052631578 is the repeating decimal Using double i get 0.947368421052631526.however, the former is correct The biggest/largest integer that can be stored in a double without losing precision is the same as the largest possible value of a double It's an integer, and it's represented exactly What you might want to know instead is what the largest integer is, such that it and all smaller integers can be. 0 if you're for some reason needing to compare a value from an input and insure that a single character is a double quote this worked for me as the comparison value
That's 4 double quotes in a row.
OPEN