double float

Nov 1, 2015 at 4:48pm
how much number can double and float hold?
Nov 1, 2015 at 5:03pm
http://www.cplusplus.com/reference/limits/numeric_limits/


Hi

Look at the example at the end, you can change the type where it has int.

The amount of significant figures these types can have is important.

float has 5 or 6 sf, while double has 15 or 16, so that is why it is the default and preferred type. Unless you are using some library which requires float, use double.
Topic archived. No new replies allowed.