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

Convert UInt64 to float

How can I convert this UInt64 to a float? UInt64 MyLongInt = 14250221004866263104; float My4ByteFloat = MyLongInt; Console.WriteLine(My4ByteFloat); This has to do with a memory read I am performing. The value I am retrieving is an UInt64 and…
John P.
  • 1,199
  • 2
  • 10
  • 33
-1
votes
1 answer

I am getting a negative value when I try to convert a uint64_t to struct timeval? //edited

#include #include #include void convert(uint64_t offset ) { struct timeval t; t.tv_sec = offset / 1000000; std::cout << "currentTimeOffset " << offset << "startTimeOffset " << t.tv_sec << std::endl; …
ashok v
  • 408
  • 3
  • 11
-1
votes
1 answer

Project euler #8 in C++ getting wrong answer that is somewhat maximum uint_64 value

Here's a link to the problem I'm trying to solve: https://projecteuler.net/problem=8. I've written a code that seems to work well while I'm calculating a product of anything from 1 to 12 (included) consecutive digits. For example the biggest product…
AlexKey
  • 16
  • 1
-1
votes
3 answers

Converting integer to binary shows different outputs when number is declared as uint32 and uint64

I was trying to convert an integer into its equivalent binary representation. I was using the following algorithm void decimal_to_binary(uint32_t number) { char bitset[32]; for(uint32_t i=0; i<32; ++i) { if((number & (1 << i)) !=…
rgk
  • 858
  • 16
  • 28
-1
votes
4 answers

Decimal.ToUInt64 "Value was either too large or too small for a UInt64

I am doing: - Decimal production = 0; Decimal expense = 5000; Decimal.ToUInt64(production - expense); But it throws exception with the following error message. "Value was either too large or too small for a UInt64" Can someone give me a workaround…
Waqas Raja
  • 10,802
  • 4
  • 33
  • 38
-1
votes
1 answer

applying a bit vector for mask

I want to do a simple bit mask operation. Lets say uint64_t a = 348659235483; Assuming this number is converted to binary, I want to extract the values from bit 6 to 12 (0 is MSB on the right end). What is the smallest code for that? the binary…
mahmood
  • 23,197
  • 49
  • 147
  • 242
-2
votes
2 answers

How do i use pointer as parameter

I write something to get famliar with pointer. void print_line(int64_t number, char *string) { (void)number; (void)string; printf("%d %s \n", number, *string); return; } int main() { print_line(42, "Hello World!"); …
tcx
  • 1
-2
votes
2 answers

strtoull was not declared in this scope while converting?

I am working with C++ in eclipse CDT and I am trying to convert string to uint64_t by using strtoull but everytime I get below error message - ..\src\HelloTest.cpp:39:42: error: strtoull was not declared in this scope Below is my C++ example…
john
  • 11,311
  • 40
  • 131
  • 251
-3
votes
2 answers

Return value from the function varies in c

I wrote a program to fetch all the phone numbers from a file which has other text like at commands and other error from other child process. Here when I try to convert the string to integer using a user-defined function I facing the problem. The…
Shameerariff
  • 165
  • 1
  • 11
-4
votes
1 answer

Convert uint64_t to cv::mat

what I have: std::vector keypoints; uint64_t* desc = new uint64_t[8 * keypoints.size()]; cv::Mat test = (keypoints.size(), 8, CV_8UC1, desc); That does not work. What am I missing? Error message is: no suitable…
Jacob
  • 13
  • 1
  • 7
-4
votes
1 answer

how to convert uint32 to uint64 in C?

im Converting a uint32_t hex number into uint32_t BCD number. and will do the same to uint64 hex to BCD... i have this from a uint16 uint16_t CvtBcd(uint16_t HexNumber) { return ((HexNumber/ 10) << 4) | (HexNumber% 10); } edit: I'm going to use…
Nazareth
  • 1
  • 1
  • 4
-5
votes
1 answer

Fill uint16_t array with uint64_t data in C

I'm having a problem trying to save a data of uint64_t size into 4 uint16_t positions in array without using any loop... Here is a part of my code: static int send(uint16_t addr, const void *data) { uint16_t frame[7]; /* Here I want to save…
OriolBur
  • 11
  • 6
1 2 3
12
13