Hey, just wondering - I've seen numbers like 1.0f in examples and in books, but what does the 'f' mean? Does it just mean that the number is a floating point number? And does including/excluding it change anything?

Recommended Answers

All 3 Replies

In simple terms, yes, it is a float. If you don't include the f I believe, technically, it is considered a double.

In simple terms, yes, it is a float. If you don't include the f I believe, technically, it is considered a double.

Even if the variable's datatype is a float? like if i were to do float fNumber = 5; , it would think that 5 is a double?

I believe in that situation it implicitly applies the f

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.