0

Possible Duplicate:
Suffix of “f” on float value?

Is there a different suffix to be used with type double or is it the case that "f" works for both?

Community
  • 1
  • 1
mrk
  • 3,061
  • 1
  • 29
  • 34

1 Answers1

2

An undecorated floating point literal like 1.5 has type double. The suffix f makes the type float (as in 1.5f), and L makes it long double (as in 1.5L).

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084
  • Is %f the format used to print doubles? – mrk Oct 17 '12 at 20:28
  • @saadtaame, Yes, one will be converted to the other when passed in as a variable argument, so there's no way for the function to tell them apart. – chris Oct 17 '12 at 20:28