Why do you put 'f' when using float?

Apr 17, 2015 at 11:03pm
float x = 1.0f;

Why would you do this?
Apr 17, 2015 at 11:07pm
closed account (2LzbRXSz)
Without the f, it would be treated as a double.

You can read more about that here
http://stackoverflow.com/questions/4828167/purpose-of-a-f-appended-to-a-number

And double v.s. float here
http://stackoverflow.com/questions/2386772/difference-between-float-and-double
Topic archived. No new replies allowed.