0

What's the difference, in C and Objective-C, between using Float64 and long?

mskfisher
  • 3,291
  • 4
  • 35
  • 48
neowinston
  • 7,584
  • 10
  • 52
  • 83

4 Answers4

6

long is integral (no decimals); Float64 (or double) is floating-point.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
1

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.

Macmade
  • 52,708
  • 13
  • 106
  • 123
1

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.

Joe Tyman
  • 1,417
  • 5
  • 28
  • 57
  • There isn't a "science notation" format for storing binary values. You can't define a word using the same word - the sentence "a long is a long integer" does not make sense. – iheanyi Apr 02 '14 at 15:28
  • @iheanyi In binary scientific notation is represented by use of a sign bit in between the second and first byte. The first byte becomes the exponent. Actually a long is short for a long integer. A long integer uses more bytes than an int(which is short for integer). – Joe Tyman Apr 09 '14 at 00:16
0

Float64 is a floating point number, and long is integral.

Cacho Santa
  • 6,846
  • 6
  • 41
  • 73