0

difference between float and double

31st Jul 2016, 1:57 PM
Ravi Kiran J
Ravi Kiran J - avatar
5 Réponses
+ 3
Double : from 1 .7e–308 to 1.7e+308 Float : from 3 .4e–038 to 3.4e+038 I hope i have helped. If you need anything more feel free to check tutorialspoint or stack overflow!
31st Jul 2016, 4:00 PM
Ousmane Diaw
+ 2
For better understand open a new java, declear a double and float as Double dmin = Double.MIN_VALUE, dmax = Double.MAX_VALUE; and print both the values using System.out.println(dmin + " " +dmax) ; Do same for float with obious change you'll know the difference
1st Aug 2016, 6:59 AM
Akshay KG
Akshay KG - avatar
0
can u ple tell the range of float and double
31st Jul 2016, 3:45 PM
Ravi Kiran J
Ravi Kiran J - avatar
0
tq u so much Mr.Akshay
1st Aug 2016, 7:45 AM
Ravi Kiran J
Ravi Kiran J - avatar
0
You will see most of the time we use double rather than float in Java . one reason is while initializing float number you have to write 'f' followed by number. float num = 3.12f; while in double, double num = 3.12;
6th Aug 2016, 10:32 AM
Suyash Kathar
Suyash Kathar - avatar