int64

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 final value of the field cannot be predicted. Three part question: Is this really true? ...

What is the int.MaxValue on a 64-bit PC?

Hi. System.Console.WriteLine(int.MaxValue); This line gives me the answer of 2147483647 as I have a 32-bit PC. Will the answer be same on a 64-bit PC? ...

Generate random values in C#

How can I generate random Int64 and UInt64 values using the Random class in C#? ...

Why do my .net Int64's behaves as if they were Int32's ?

I'm witnessing a strange behavior in a .net program : Console.WriteLine(Int64.MaxValue.ToString()); // displays 9223372036854775807, which is 2^63-1, as expected Int64 a = 256*256*256*127; // ok Int64 a = 256*256*256*128; // compile time error : //"The operation overflows at compile time in checked mode" // If i do this at runtime, I...

Converting int64 to NSData

Hi guys, I need to convert a long value from int64 to NSData, so I can later run a hash algorithm on it. I perform: int64_t longNumber = 9000000000000000000L; NSMutableData *buffer = [NSMutableData dataWithBytes:&longNumber length:sizeof(longNumber)]; NSLog(@"%lld", [buffer bytes]); NSLog(@"%lld", longNumber); The resultant console ...

How to sort a part of an array with int64 indicies in C#?

The .Net framework has an Array.Sort overload that allows one to specify the starting and ending indicies for the sort to act upon. However these parameters are only 32 bit. So I don't see a way to sort a part of a large array when the indicies that describe the sort range can only be specified using a 64-bit number. I suppose I could...

Inaccurate division of doubles (Visual C++ 2008)

I have some code to convert a time value returned from QueryPerformanceCounter to a double value in milliseconds, as this is more convenient to count with. The function looks like this: double timeGetExactTime() { LARGE_INTEGER timerPerformanceCounter, timerPerformanceFrequency; QueryPerformanceCounter( if (QueryPerformance...

How can i serialize variable with type of Int64 in JavaScript without loss of accuracy?

Hi everybody,How can i serialize variable with type of Int64 in JavaScript without loss of accuracy? My development platform is. NET. ...

How to change System.DirectoryEntry "uSNChanged" attribute value to an Int64

I'm trying to get the Int64 value of a Directory Services object's "uSNChanged" value. Unfortunately, it is always coming back as a COM object of some kind. I've tried using casting to Int64, calling Int64.Parse(), and calling Convert.ToInt64(). None of these work. For a given DirectoryEntry object, this code will display the properties...

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. But now under C++ I am forced to use LARGE_INTEGER because that's what QueryPerformanceCo...

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 ...

FILETIME to __int64

What is the proper way to convert a FILETIME structure into __int64? Can you please tell me? ...

prototype of int64_t or offset64 both linux and windows 32bits system

I am developing a application which needs functions of int64 variables. and i was told offset64 or int64_t is viable for my need... But i just wanna what is the prototype of int64 under 32bit system... How can i use the variable. is it a struction which consists of two ULONGs? thanx ! ...

Converting __int64 to long in Windows

How to convert __int64 to long in Windows (MSVC8 & MSVC6)? Will a normal typecasting work? Also, how about converting long to __int64? If the long is a negative value, will it work? Note - I am talking of a scenario in which the __int64 variable will always contain a value which will not be more than 32 bits long. ...

Converting an int64 value to a Number object in JavaScript

I have a COM object which has a method that returns an unsigned int64 (VT_UI8) value. We have an HTML page which contains some JavaScript which can load the COM object and make the call to that method, to retrieve the value as such: var foo = MyCOMObject.GetInt64Value(); This value can easily be displayed to the user in a message dia...

How to retrieve a bigint from a database and place it into an Int64 in SSIS

I ran into this problem a couple years back and am hoping there has been a fix and I just don't know about it. I am using an 'Execute SQL Task' in the Control Flow of an SSIS package to retrieve a 'bigint' ID value. The task is supposed to place this in an Int64 SSIS variable but I getting the error: "The type of the value being assigned...

How to write INT64 to CString

I am coding in c++ windows. INT64 dirID = -1; CString querySQLStr = _T(""); querySQLStr.Format(L"select * from ImageInfo where FolderPath=%64d;", dirID); querySQLStr always like this: select * from ImageInfo where FolderPath= 1214; is it right to use %64d? Many Thanks ...

Most efficient way to compare two __int64 numbers and get -1,0,1

I have been struggling with a very simple problem... I am working with a 4 dimensional cube using AVL trees... now the problem is a performance related one... basically I have to compare billions of 64 bit numbers... (because my key is 64bit comprising the 4 dimensions of 16bits each)... The problem is not that I can't compare 2 64-bit ...

How to use Int64 in C#

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