- 1

Difference between int, float, double?

I know this three are for numbers but still don't see the difference

4th Sep 2016, 2:15 PM
Daniel Rojas
Daniel Rojas - avatar
2 Answers
0
int is a type for integer numbers (0, ±1, ±2, ...). float and double are types for floating point mathematics and can store real numbers (like 2.5, -100.100, etc). float and double differ by their size in memory and thus precision they can provide. The reason you have different types for those is that underlying mathematics for integers and floating point numbers are very different, being much more complex for the latter, up to the point when different parts of CPU do integer and floating point operations (google FPU and ALU).
4th Sep 2016, 2:45 PM
trueneu
trueneu - avatar
0
thanks :)
4th Sep 2016, 2:50 PM
Daniel Rojas
Daniel Rojas - avatar