Questions tagged [unsigned-long-long-int]

unsigned long long int specified in the C99 standard

unsigned long long long int is at least 64-bit in size and was specified in the C99 standard. It is the same as long long but unsigned.

162 questions
0
votes
1 answer

not able to shift hex data in a unsigned long

i am trying to convert IEEE 754 Floating Point Representation to its Decimal Equivalent so i have an example data [7E FF 01 46 4B CD CC CC CC CC CC 10 40 1B 7E] which is in hex. char strResponseData[STATUS_BUFFERSIZE]={0}; unsigned long strData =…
0
votes
1 answer

Acquire a long int from a binary file

I have a binary file in which 64 bits blocks are a number that I need. If I try to read it with: FILE *ptr; ptr = fopen("HH", "rb"); //r for read, b for binary ulong val; fseek(ptr, 0, SEEK_SET); fread(&val, 8, 1, ptr); it doesn't work (it gives…
domx
  • 13
  • 1
0
votes
2 answers

problem when converting a .const file (c++) to .java class

I have a .const file, lets say abc.const (a cpp file). the contents of that file is, xyz :ullong:0x1000000000000000ULL yub :ullong:0x0100000000000000ULL .... .... now i ve a program to convert this file to .java class. But when i try above, i got…
0
votes
1 answer

How to interpret hex to unsigned long int (20-bits integer, 12-bits fraction, modulo 20-bits)

I'm getting data from a sensor in the form of UDP packets. The manual provides the form for these packets, but I'm having trouble understanding how to interpret the timestamp. It's described as being an unsigned long that is 4 bytes in length (e.g.…
0
votes
2 answers

Non consistent results when calculating the same integer with different expressions

Arithmetic result for the same expression lead to different outcomes depending on wether I define an integer in one line or I use several steps: int main() { unsigned long long veryBigIntOneLine = ((255*256+255)*256+255)*256+255; unsigned…
0
votes
0 answers

Double, unsigned long long and char array [C program]

I received a function that i need to implement in my code. The function is working on it's own self tester. Here it is with struct associated (i can make an executable example if needed) : #define STEERINGCMD_MSG_BUFFERLENGTH 40 typedef…
HacHac
  • 147
  • 11
0
votes
0 answers

pow() function returning different result in C++

As we know that the range of unsigned long long int is 0 to 18,446,744,073,709,551,615 Means , unsigned long long int is capable for handling 19-20 digits easily. So, I want to know why my this program is returning different value. Program…
SAPJV
  • 115
  • 8
0
votes
2 answers

unsigned long and uint32_t?

I'm studying socket programming and I learned inet_addr function. But I'm confused how can I handle in_addr_t type. inet_addr function returns in_addr_t type which is uint32_t, then do I have to use uint32_t type variable to handle it? In the book,…
coder
  • 95
  • 1
  • 1
  • 5
0
votes
0 answers

After using unsigned long long int in c , program not asking for next input and unexpectedly exiting

So basically I have to write a program which works with integers ranging from 0 to 10^18 digits long. I was trying to see how can I input such long number in C and then use it. I decided to use unsigned long long int but after using that the program…
0
votes
1 answer

How to handle "unsigned long long int" in computations?

I have 64b architecture and Windows and g++ 6.3.0 and have problem in some situations in formula: double a = (element_radius_square - element_to_check_intersection.radius * element_to_check_intersection.radius + distance_between_centers *…
Lukas Salich
  • 959
  • 2
  • 12
  • 30
0
votes
1 answer

C - RSA Cryptosystem Decryption Issue (unsigned long long not big enough?)

I'm working on an assignment where I have to build an RSA Cryptosystem. I was able to encrypt the cipher key no problem however I'm having trouble decrypting it due to the result of the exponent being so large. I've tried using unsigned long long…
DazedFury
  • 59
  • 9
0
votes
3 answers

Big numbers in C

I'm implementing RSA in C. I'm using "unsigned long long int" (Top limit: 18446744073709551615). The problems come when I have to calculate thing like 4294967296 ^ 2. It should be 18446744073709551616, but I get 0 (overflow). I mean, I need to…
Alan
  • 1
  • 1
  • 2
0
votes
0 answers

overflow of the multiplication of unsigned long long int

I have doubt about the multiplication of unsigned long long int in the G++ 5.4.0 compiler. Why the 1st snippet overflows even though the variable n is unsigned long long int type? Why the 'LL' behind 8 works? Please give me some keyword that I can…
Shirley Feng
  • 143
  • 1
  • 10
0
votes
1 answer

Storing unsigned long value in two 16bit register

I want to store unsigned long value in two 16bit register.For example if I have long value (-2,147,483,648 to 2,147,483,647) then I'm using formula like: v[0] = myValue % 65536 v[1] = myValue / 65536 To get value from register outVal = reg0 + (reg1…
Josef
  • 2,648
  • 5
  • 37
  • 73
0
votes
1 answer

How to Generate distinct large random number/keys in c++

generate large random number in c++ which is closely near to pow(2, 64)-1. Explain that problem that let say we should generate n random numbers in which mostly is big and stored them in a array.