reset password
Author Message
harry_520
Posts: 76
Posted 20:30 Jan 08, 2015 |

For the height, should we use int or double?

303496263
Posts: 68
Posted 20:33 Jan 08, 2015 |

I thought it's obvious that the variable should be of type double.

kknaur
Posts: 540
Posted 05:18 Jan 09, 2015 |

My general rule of thumb for int vs double is always "if your value could potentially be a floating point value and you are not doing any kind of integer only arithmetic, then you should use a double."  You have to consider all possible values and how the value for that particular variable is normally measured in the real world.