Roughly speaking, there are two kinds of numbers: integer numbers and real numbers.
Real numbers can have fractional parts, whereas integers can’t.
For example, it is not possible to represent the rational number 22/7 as an integer number, but the same number can be represented as a real number (3.142857).
When a function takes a double (a type for representing real numbers) as an argument, you can give it an integer number or a real number; it will receive the number you give without any loss (roughly speaking again).
However, if you give a real number to a function taking an integer as an argument, it will receive only the whole part (integer part) of the number; the fractional part is lost.
Here is an example:
#define MY_Log1(P1, P2) NSLog (@"%s: "P1, __PRETTY_FUNCTION__, P2)
void PrintLong (long);
void PrintDouble (double);
int main (int argc, const char * argv)
const double MY_PI = 22.0 / 7.0;
void PrintLong (long v)
void PrintDouble (double v)
2012-08-17 22:31:22.692 RealNumbers[15843:403] void PrintLong(long): v=3
2012-08-17 22:31:22.694 RealNumbers[15843:403] void PrintDouble(double): v=3.142857