Float vs. Double | Sololearn: Learn to code for FREE!

+1

Float vs. Double

Can a value be at the same time double and float? Explain please I thought 14.55 was either double or float depending on the programmer's choice

2/2/2020 9:38:46 AM

Jack Ndabelo

2 Answers

New Answer

+6

A decimal point value is always by default a double. You need to declare it as float for it be a float.

+1

You can add "f" if you want to prevent it from being a double by default: 5.4f //float 5.4 //double