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
3 answers

How can a double be converted to bytes to be stored in c++?

I am trying to write a program that can take a list of a specific type for example a double or float and convert it into bytes and write it to a file that can be converted back into that original list. I came up with the following structs and…
Sam Moldenha
  • 463
  • 2
  • 11
0
votes
0 answers

Difference in time taken with different types

I was writing some code and noticed this. When I use double, the time taken is slower than when I use uint64_t. Here is the code I was using: Double: #include #include #include int main () { double sum = 0; …
0
votes
1 answer

UInt64 on a 32 bit system, need to generate from UInt32's or array of bytes, how?

To generate UInt64 the following results in "warning C4293: '<<' : shift count negative or too big, undefined behavior" UInt64 byteArrayToUInt64(int %stI, array^ byteArray) { UInt64 retV = byteArrayToUInt32(stI, byteArray); retV |=…
John
  • 6,433
  • 7
  • 47
  • 82
0
votes
2 answers

Comparing int64 and float value does not work inside loop

The following loop would run only when off which is uint64_t is less than the value returned by ceil which is double. However I don't see the loop being executed. #include using namespace std; int main() { uint64_t offset =…
0
votes
0 answers

Why does uint64_t value change when it is being assigned into unit64_t** array element?

I am trying to simulate a memory manager in C language. I need help solving a problem with assigning uint64_t values into an uint64_t** array elements. After writing the code, I tested it by trying to write several values. ex:- 0x2222222222222222,…
Kavindu Ravishka
  • 711
  • 4
  • 11
0
votes
1 answer

Is it possible to generate uint64_t random numbers on GPU?

I am trying to port finite field CPU code over GPU and in the process, I would like to generate random vectors to test the speed of my functions. I need two random vectors of uint64_t (and the corresponding two vectors of double, with float…
Dimitri Lesnoff
  • 317
  • 1
  • 14
0
votes
0 answers

bitwise XOR in Javascript with a 64 bit integer

I am looking for a way of performing a bitwise XOR on a 64 bit integer in JavaScript. JavaScript will cast all of its double values into signed 32-bit integers to do the bitwise operations. I already found this function in bitwise AND in Javascript…
0
votes
1 answer

How do I use in an array

i'm pretty new to C++ and am trying to make an array in which every element is of a specific bit-size. I've tried doing this: Sequence; In which Sequence would be the array name and every element would have a size of 64 bits. However get…
Pol
  • 1
0
votes
1 answer

Typecasting uint64 into double precision

I'm receiving a list of bytes, in an array called "info," into the subroutine shown below. They were received serially and gathered up into the array. Elements [6] - [13] of the array represent one double precision number. They were necessarily…
0
votes
0 answers

Bitshifting a uint64_t gives wrong result

As was said in the title, bitshifting a uint64_t type gives wrong results. I have absolutely no idea why this is the case. It seems like on the edges of the shifted bytes, it's modified the values to the the inverse of what they were originally. An…
NickKnack
  • 119
  • 1
  • 8
0
votes
1 answer

C# UInt64 subtract issue

Why subtraction with UInt64 data type sometimes error occurs. I reduce the number of seconds timespan with the result should be between 1 - 10, but the results of the system can be millions or even billions? Bugs ? private bool…
Slocky
  • 123
  • 2
  • 12
0
votes
1 answer

Unexpected result of logical AND operation between two uint64_t numbers

In the following code, I check if the result of the logical AND operation equals zero: #include #include int main() { uint64_t num1 = 0b0000000000000000000000000000000000000000000000000000000000000000; uint64_t num2 =…
MrPontes
  • 29
  • 5
0
votes
1 answer

python Pandas optimization for ubyte data (0..255)

How is it possible to optimize Pandas df to ubyte data type (0..255)? (by default is int64 for integer) If I will convert data to Categorical type, will df use less memory? Or the only way to optimize it - use NumPy instead of Pandas?
ratel
  • 13
  • 3
0
votes
1 answer

Function with the same argument does not return the same value

I was "playing" with the fast inverse sqrt function by trying to optimize certain things (fewer variables etc). Here is the final code: float Q_rsqrt(float x) { const float x2 = x * 0.5F; uint_fast32_t i; memcpy(&i, &x, sizeof(float)); …
TheBigBadBoy
  • 611
  • 5
  • 14
0
votes
2 answers

Cannot declare any signed Integer types in C#

I'm working on an ASP.NET application in Visual Studio 2019. I'm running into a problem I've never encountered with C# before. I seemingly cannot declare any integer types other than UInt64. Trying to declare an Int64 or a long gives me errors,…