Questions tagged [int64]

The int is a datatype that represents an integer and is coded on 64 bits in memory.

int64 is a datatype that represents an (a whole number, not a fraction) and is coded on 64 bits in memory. Unlike its counterpart which is , int64 can be used to store positive and negative integers of values between -263 to 263 - 1.

260 questions
19
votes
4 answers

How to use Int64 in C#

The question is easy! How do you represent a 64 bit int in C#?
user182513
19
votes
5 answers

I want to get the low 32 bit of a int64 as int32

I have an Int64 value, but I only need the lower 32 bits. Thus I want a quick way to get the Int32 value from the lower 32 bits of the Int64 value. Thanks
qingsong
  • 715
  • 3
  • 7
  • 13
18
votes
6 answers

Under C# is Int64 use on a 32 bit processor dangerous

I read in the MS documentation that assigning a 64-bit value on a 32-bit Intel computer is not an atomic operation; that is, the operation is not thread safe. This means that if two people simultaneously assign a value to a static Int64 field, the…
Noah
  • 15,080
  • 13
  • 104
  • 148
15
votes
2 answers

Is it ok to use 64bit integers in a 32bit application?

I notice in C and C++, we can use int64_t, or simply a long long. If I compile 32bit code using these types, will I suffer any performance issues on 64bit and/or 32bit machines? Aside from saving some RAM, would I ever have a reason to just use…
Nyaarium
  • 1,540
  • 5
  • 18
  • 34
14
votes
7 answers

FILETIME to __int64

What is the proper way to convert a FILETIME structure into __int64? Can you please tell me?
akif
  • 12,034
  • 24
  • 73
  • 85
14
votes
1 answer

Best way to load a 64-bit integer to a double precision SSE2 register?

What is the best/fastest way to load a 64-bit integer value in an xmm SSE2 register in 32-bit mode? In 64-bit mode, cvtsi2sd can be used, but in 32-bit mode, it supports only 32-bit integers. So far I haven't found much beyond: use fild, fstp to…
Eric Grange
  • 5,931
  • 1
  • 39
  • 61
14
votes
6 answers

manipulating LARGE_INTEGERS

I am converting some code from C to C++ in MS dev studio under win32. In the old code I was doing some high speed timings using QueryPerformanceCounter() and did a few manipulations on the __int64 values obtained, in particular a minus and a divide.…
Mick
  • 8,284
  • 22
  • 81
  • 173
14
votes
3 answers

Which initializer is appropriate for an int64_t?

I like to initialize my variables to some "dummy" value and have started to use int64_t and uint64_t. So far, it looks like there are at least three ways I could initialize an int64_t to a particular value (and with slight changes for the unsigned…
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
12
votes
2 answers

json parsing of int64 in go; null values

I'm trying to parse a json stream in Go. I've created a simplified example: package main import ( "encoding/json" "fmt" ) var d = []byte(`{ "world":[{"data": 2251799813685312}, {"data": null}]}`) type jsonobj struct{ World []World } …
kazamatzuri
  • 413
  • 1
  • 3
  • 12
11
votes
2 answers

Why can integer type int64_t not hold this legal value?

I'm trying to write a test case for some corner case. For input of type int64_t, the following line won't compile: int64_t a = -9223372036854775808LL; The error/warning is: error: integer constant is so large that it is unsigned [-Werror] I…
fluter
  • 13,238
  • 8
  • 62
  • 100
11
votes
2 answers

Cross platform definition of 64 bit integers in C++ for Windows and Linux

I am trying to write cross-platform code in C++ for Windows(MinGW) and Linux(g++). I was used to define 64 bit integers in Linux as "long", but when I moved to MinGW, the sizeof(long) returned 4 bytes. Then I discovered that I can use "long long" or…
Jaime Ivan Cervantes
  • 3,579
  • 1
  • 40
  • 38
10
votes
5 answers

std::atoll with VC++

I have been using std::atoll from cstdlib to convert a string to an int64_t with gcc. That function does not seem to be available on the Windows toolchain (using Visual Studio Express 2010). What is the best alternative? I am also interested in…
Cookie
  • 12,004
  • 13
  • 54
  • 83
9
votes
2 answers

Swift: Cast Any Object to Int64 = nil

i have a question. I was wondering why this is happend? var dict : [String : Any] = ["intValue": 1234, "stringValue" : "some text"] dict["intValue"] as? Int64 // = nil (why) dict["intValue"] as? Int // = 1234 can anybody tell me why the cast to…
Daniel Schmidt
  • 139
  • 1
  • 6
9
votes
3 answers

Convert uint64 to int64 without loss of information

The problem with the following code: var x uint64 = 18446744073709551615 var y int64 = int64(x) is that y is -1. Without loss of information, is the only way to convert between these two number types to use an encoder and decoder? buff…
wheaties
  • 35,646
  • 15
  • 94
  • 131
8
votes
2 answers

_int64 does not name a type

In my pch file I have the following definitions: #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short…
Nitish
  • 13,845
  • 28
  • 135
  • 263
1
2
3
17 18