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

access violation casting to void* and back

I get an access violation reading location when I try the following. What am I doing wrong? uint64_t hInt = 2901924954136; void* hPoint = reinterpret_cast(hInt); uint64_t hIntBack = *static_cast(hPoint); //get access violation…
user3294816
  • 37
  • 1
  • 7
0
votes
1 answer

Integers Larger than Int64

I'm attempting to get a user input number and find the sum of all the digits. I'm having issues with larger numbers, however, as they won't register under an Int64. Any idea as to what structures I could use to store the value? (I tried UInt64 and…
R. R
  • 55
  • 2
  • 8
0
votes
3 answers

How to perform shift left of 64bit in C

I am trying to copy two 32bit values into one 64bit address. One DWORD is the high 32 bits and the second is the low 32 bits. I tried the following but the shift operand in the 64bit values doesn't work: UINT64 a = 0x12341234; UINT64 b =…
user1016179
  • 599
  • 3
  • 10
  • 24
0
votes
2 answers

Timestamp difference with two decimals c++

I have to timestamps (in µs), which are stored as a uint64_t. My goal is to be able to get the difference between these timestamps in ms, as a float with 2 decimals. Fx I'd like the result to be 6.520000 ms. Though I can't seem to get them to…
Benjamin Larsen
  • 560
  • 1
  • 7
  • 21
0
votes
4 answers

How to copy hex representation of uint_64 to unsigned char array in hex, in C?

I'm not sure how to put what I am trying to achieve in words, but I'll just put an example below, hope you guys can lend me a hand! Basically I'm trying to copy the hex representation of uint64_t value into an unsigned char array, in hex. What I…
Lee Jun Wei
  • 310
  • 3
  • 11
0
votes
1 answer

How to use arithmatic operations on uint64_t?

I am trying to make a program that simply divides the number given number and prints out the remainder and the solution of the given number divided by 10. However my code isnt printing out the correct values. Here is the following code: #include…
h101
  • 31
  • 1
  • 5
0
votes
1 answer

Xamarin Forms - ResourceDictionary and value

It's a simple question, maybe stupid, but I'm stuck from hours.. I have that in the XAML part: 50
Emixam23
  • 3,854
  • 8
  • 50
  • 107
0
votes
1 answer

Parse uint to positive long and have a 1 to 1 matching

Is there a safe way to parse Uint numbers into positive Long numbers and have a one to one matching between that uint and the long number??
user5326354
0
votes
1 answer

How to read sequence of bytes from pointer in C++ as long?

I have a pointer to a char array, and I need to go along and XOR each byte with a 64 bit mask. I thought the easiest way to do this would be to read each 8 bytes as one long long or uint64_t and XOR with that, but I'm unsure how. Maybe casting to a…
Nabushika
  • 364
  • 1
  • 17
0
votes
0 answers

Converting struct to uint64 causes custom OS to crash

I'm currently making my own OS. I've successfully created an IDT, and I wanted to improve performance, so I thought using uint64_ts and bit shifting would help me. The whole file is a bit too large to show here, so I'm going to show only the…
Shahe Ansar
  • 314
  • 2
  • 12
0
votes
2 answers

Computing determinant and using division and multiplication of uint64_t C type

This question has been edited to clarify it. I have the following matrix, defined in page 1 of [reteam.org/papers/e59.pdf], written in R notation: m1 =…
Marc Kees
  • 206
  • 2
  • 15
0
votes
2 answers

iOS UInt64 number to float error

UInt64 intValue = 999999900; float tt = intValue; NSLog(@"float tt = %f", tt); the output result is "float tt = 999999872", as you can see the UInt64 convert to float lose something, the Max float is bigger than 999999900, so I think the value…
0
votes
2 answers

C++ uint64_t bitwise AND check for even number

I have the following code that simply checks if a uint64_t is even, I intended on using a bitwise AND operation to check but it doesn't seem to be working. This is the code I thought would work first: int n; scanf("%d",&n); for(int i = 0; i < n;…
0
votes
1 answer

c++ (OpenBSD 5.8 amd64), outputting uint64_t as a real number

Trying to understand why I get the following output from my program: $ ./chartouintest UInts: 153 97 67 49 139 0 3 129 Hexes: 99 61 43 31 8b 00 03 81 uint64 val: 8103008b31436199 $ I am trying to output just the actual UInt64 numerical value,…
nethereal
  • 11
  • 2
0
votes
2 answers

Large number in binary

I have to take an integer of 80 bits in argument, convert it on binary and then make some bit shifts operation on it. I use this snippet (which seems to work fine) to store the argument: uint64_t n; seed= strtol(argv[1], &p, 10); printf("n:%" PRIu64…
Shan-x
  • 1,146
  • 6
  • 19
  • 44