C and Objective-C: What's the difference between using Float64 and long?
What's the difference, in C and Object开发者_如何学编程ive-C, between using Float64 and long?
long
is integral (no decimals); Float64
(or double
) is floating-point.
Long is an integral format, usually on 64bits, but platform-dependant. Float64 is a floating point format, written on 64its (usually double), but guaranteed to be on 64bits.
Like mention before one is a integer and one is a float. The basic difference is the ability to have a decimal point, which a real/float can have and integer can not have. If all things were equal a float is stored in science notation, while an integer is not. A float would allow for a much much bigger number and has no need for being unsigned. A double is a long float, and long is long integer so they are larger values. Also in ANSI C there is no Float64.
Float64 is a floating point number, and long is integral.
精彩评论