However, in most cases, float and double seem to be interchangeable, i.e 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 Using one or the other does not seem to affec.
945 best Double Barrel images on Pholder | Worldof Tanks, Forgotten
The 53 bits of double s give about 16 digits of precision
The 24 bits of float s give about 7 digits of precision.
You don't have to guess, just check the jls Int to double is a widening conversion Widening primitive conversions do not lose information about the overall magnitude of a numeric value [.] conversion of an int or a long value to float, or of a long value to double, may result in.
In my earlier question i was printing a double using cout that got rounded when i wasn't expecting it How can i make cout print a double using full precision? 494 a double is not an integer, so the cast won't work Note the difference between the double class and the double primitive
Also note that a double is a number, so it has the method intvalue, which you can use to get the value as a primitive int.
When should i use double instead of decimal Has some similar and more in depth answers A similar question for c/c++ (as this may be the top search engine hit) How can i get double quotes into a string literal?
A double has a much higher precision due to it's difference in size If the numbers you are using will commonly exceed the value of a float, then use a double Several other people have mentioned performance isssues That would be exactly last on my list of considerations
Correctness should be your #1 consideration.
The double not in this case is quite simple It is simply two not s back to back