What is a float ? please explain with example | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is a float ? please explain with example

4th Mar 2016, 11:06 AM
Samyak Shirsh
Samyak Shirsh - avatar
4 Answers
+ 5
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:35 AM
Suyash Kathar
Suyash Kathar - avatar
+ 2
It's a "floating point" number; a number which has digits after the decimal point. 73 is an integer. -12 is also an integer. 12.5, 659.342 and -0.000003218 are floats.
8th Apr 2016, 12:09 AM
Tony W
+ 1
It's a "floating point" number; a number which has digits after the decimal point. 73 is an integer. -12 is also an integer. 12.5, 659.342 and -0.000003218 are floats.
27th Jun 2016, 9:27 PM
soheib
0
float is data type which is used to represent floating point value or number
25th Jan 2017, 2:15 PM
Pansare Shyam