Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   General Discussion (http://siteownersforums.com/forumdisplay.php?f=2)
-   -   What is the difference between double and float variables in Java? (http://siteownersforums.com/showthread.php?t=977881)

preetiagarwal 05-31-2019 02:07 AM

What is the difference between double and float variables in Java?
 
In java, float takes 4 bytes in memory while Double takes 8 bytes in memory. Float is Single precision floating point decimal number, while Double is double precision decimal number.
https://www.exltech.in/java-training.html

RH-Calvin 07-14-2019 10:46 PM

Though both float and double datatype are used to represent floating point numbers in Java, a double data type is more precise than float. A double variable can provide precision up to 15 to 16 decimal points as compared to float precision of 6 to 7 decimal digits.


All times are GMT -7. The time now is 10:02 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.