Questions tagged [uint64]

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

uint64 is a datatype that represents an and is coded on 64 bits in memory. Unlike its counterpart which is , uint64 can only be used to store positive integers, of values between 0 and 264 - 1.

192 questions
0
votes
1 answer

Are there platforms that do not support uint64_t?

I am working on a project that relies on the standard C datatype uint64_t to multiply 32 bit integers. But I am concerned about portability issues, as I am already re-implementing many parts of my source code in C due to portability reasons. I…
Vivekanand V
  • 340
  • 2
  • 12
0
votes
1 answer

Printing uint64_t* value in C

I am using the following code: size_t offset = (rand() << 12) % chunk_size; uint64_t *addr = (uint64_t*) (chunk+offset); fprintf(stdout,"addr: %" PRIx64 " ", addr); I included library but i got the folowwing error: error:…
user13938059
0
votes
0 answers

Why minus operator on uint64_t gives me wrong results?

in my super advanced code below I try subtract next values from a big num. I can't understand why this gives me wrong results. I am using cygwin gcc. $ gcc --version gives me gcc (GCC) 6.4.0 uint64_t val = 0xFFFFFFFFFFFFFFFFULL; // 0xFF FF FF FF…
0
votes
1 answer

Base64 Encoded String from Array of Uint64 in Swift

How can I create a base64 encoded string from 4 UInt64 integers? I presume there are a few steps to this that i'm not sure how to approach, such as combing integers, converting to binary, or perhaps constructing string using some loop over…
J. Doe
  • 33
  • 7
0
votes
1 answer

Finding the binary composition of a binary number

Very new to C#, so this could be a silly question. I am working with alot of UInt64's. These are expressed as hex right? If we look at its binary representation, can we return such an array that if we apply the 'or' operation to, we will arrive back…
0
votes
1 answer

Are overflow operators less efficient than performing operations that don't result in overflows?

What I Am Doing: I am writing a chess engine in Swift. One of the most important parts of writing a strong chess engine is the ability to generate as many possible future board positions in as little time possible. The more positions your engine can…
David Chopin
  • 2,780
  • 2
  • 19
  • 40
0
votes
2 answers

CRC - uint64 to two bytes?

I am using this CRC package to calculate XMODEM CCITT crc values for messages. The crc values are uint64s, and the author demonstrates printing the hex value of the CRC code as two bytes using // crc1 is a uint64 fmt.Printf("CRC is 0x%04X\n", crc1)…
Brandon Dube
  • 428
  • 1
  • 10
  • 26
0
votes
1 answer

Import data from simple .csv file as uint64_t manually

I've been struggling with this program for a long time. The goal is to read a simple .csv file without using libcsv. After researching and programming I've come up with this implementation. It's almost there but it fails just at the end. I suspect…
CSLearner
  • 1
  • 1
0
votes
2 answers

How to insert integer values to rocksdb like uint64_t?

I've tested following code for inserting integer values like uint64_t to the rocksdb database using casting . Is that a correct approach…
Kaviranga
  • 576
  • 2
  • 10
  • 24
0
votes
1 answer

how to convert uint64 to hexadecimal

I wonder how I can convert an unsigned integer 64bit to the hexadecimal? I have the value as '65536L' and what I am expected is '0x0000000000010000'. Many Thanks
Royeh
  • 161
  • 1
  • 11
0
votes
1 answer

Converting __int64 to FileTime

I have a code which is getting SystemTime as FileTime using uint64 currentUtcFileTime; GetSystemTimeAsFileTime((FILETIME*)¤tUtcFileTime); Now I want to convert this uint64 back to FILETIME.
Neha
  • 39
  • 6
0
votes
0 answers

Golang How to convert large uint64 to float?

When I print out the maximum values for uint64, float32 and float64 it seems as though a float should accommodate a uint64. However, I've tried a number of conversions and large uint64 numbers do not convert accurately. Am I doing something…
0
votes
2 answers

What is the correct way to handle 64 bit unsigned integers in PHP?

When running PHP on 64 bits machines max integer value is 0x7fffffffffffffff; differently noted 9223372036854775807 (except on Windows prior to PHP 7, where it was always 32 bit). According to the related PHP manual page PHP does not support…
e-sushi
  • 13,786
  • 10
  • 38
  • 57
0
votes
2 answers

In C, how to set the MSB of an uint64_t according to a variable

In C, I have a variable of the type uint64 (x) and a variable of type int (i). I need to change the MSB of x to the value of i (which will vary). How can I achieve that. Please help! int i; // .. some code here that will set i to 0 or to 1.…
J.avier
  • 33
  • 5
0
votes
2 answers

how to deal with hex values higher than 7FF... 64 bits and uint64_t type

I am working with 64bit hex strings and, when I want to have the number in uint64_t, if the number is higher than 7f... it will not convert the number correct. Since I'm not english, i think i can show the problem better with a piece of code: …