19

The question is easy! How do you represent a 64 bit int in C#?

Wok
  • 4,956
  • 7
  • 42
  • 64
  • 6
    @Lucero, It should be asked and answered on SO. So point to a duplicate or let it be. – H H Oct 02 '10 at 17:39

4 Answers4

37

64 bit int is long

Saeed Amiri
  • 22,252
  • 5
  • 45
  • 83
16

System.Int64 is the .net type, in C# it's also called long

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
10

A signed 64 bit integer is long, an unsigned is ulong.

The corresponding types in the framwwork are System.Int64 and System.UInt64, respectively.

Example:

long bigNumber = 9223372036854775807;
Guffa
  • 687,336
  • 108
  • 737
  • 1,005
5

By using the long data type, or ulong for unsigned.

Table of Integral C# Types

RPM1984
  • 72,246
  • 58
  • 225
  • 350