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.

151 questions
0
votes
2 answers

C program to find the n'th prime number-

#include #include #include int prime(long long int); long long int *arr; //array to hold n prime numbers int main() { int i,count=4;; long long int n; scanf("%lli",&n); arr=malloc(sizeof(long…
Devarshi
  • 11
  • 1
0
votes
2 answers

unsigned long int giving integer overflow

I am trying to create a program in c to solve sudoku puzzles,in which i am trying to store a number equal to 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 29 in an unsigned long int variable. on compiling with boath gcc and g++ on a 32 bit Ubuntu…
Prakhar Singh
  • 872
  • 2
  • 9
  • 34
0
votes
4 answers

java converting int to short

I am calculating 16 bit checksum on my data which i need to send to server where it has to recalculate and match with the provided checksum. Checksum value that i am getting is in int but i have only 2 bytes for sending the value.So i am casting int…
changed
  • 1,913
  • 7
  • 33
  • 53
0
votes
1 answer

Datatype which can store very large value in C

Recently in programming contest in Here, the problem is pretty straight forward but catch is with worst case scenario which we have to handle data of size 10^10000 . I tried the program in python which is straight forward as i don't have to specify…
KARTHIK BHAT
  • 1,340
  • 11
  • 22
0
votes
1 answer

handling overflow in Objective C

I'm building a hex calculator in objective-c. My problem is dealing with long long values that would overflow when multiplied. When I add values before I add i check that the value would not overflow by doing something like this. long long…
0
votes
1 answer

Why are signed negative numbers converted to unsigned numbers?

Particularly i have a large unsigned number and a large signed negative number. Why can't I divide a large number by a negative number C++ When I try to divide the two, I get the result zero simply because something somewhere is converting my signed…
0
votes
3 answers

C++ unsigned long and <

I have the following code: while( int()(uStartFrame - iFrameOffset) < 1) { iFrameOffset--; } uStartFrame and iFrameOffset are both unsigned long, so the < statement is a little difficult, I think. However, I thought that I fixed it using…
tmighty
  • 8,222
  • 19
  • 78
  • 182
0
votes
1 answer

How to use stoull on VS2008?

Do you have any idea on how to use stoull on Visual Studio 2008? I want to convert string to unsigned long long. Thanks!
0
votes
1 answer

Get the network 5bytes warning left shift count >= width of type

My machine is 64 bit. My code as below: unsigned long long periodpackcount=*(mBuffer+offset)<<32|*(mBuffer+offset+1)<<24|* (mBuffer+offset+2)<<16|*(mBuffer+offset+3)<<8|*(mBuffer+offset+4); mBuffer is unsigned char*. I want to get 5 bytes data…
0
votes
1 answer

unsigned long long to binary

I am trying to check the set bits of an unsigned long long in c++ using below algorithm which only checks whether the bit is set or not.But my problem is the answer that I get is wrong.Please help me understand how unsigned long long is stored in…
g4ur4v
  • 2,992
  • 5
  • 25
  • 53
0
votes
3 answers

Unsigned long returning negative in C++

below when any of the numA-D is multiplied numerous times the number suddenly becomes a negative. For example when numA is multiplied 3 times by 256 the number then becomes negative,but not if only multiplied by 256 twice. The purpose of this…
user1739860
0
votes
3 answers

C++ Largest Numerical Storage

Is there an equivalent to Java's Bigint in C++ that can store the following…
Richard
  • 5,010
  • 24
  • 106
  • 182
0
votes
3 answers

Division of a long long C type

I need to use the 'long long' c type, to store data in a very large array. Since my code is large, I made up this fairly simple code which has the same problem. So, it iterates 222 times in the loop, and prints out when the loop reaches 50% (of…
Anoracx
  • 408
  • 6
  • 21
0
votes
2 answers

Will a 64-bit Unsigned Integer wrap around on 32-bit system?

Simple question, need an answer quickly please! Take this situation on a 32-bit machine: Unsigned long long n = 1; n -= 2; I know on a 64-bit machine, this would wrap around to the highest unsigned long long. But what would happen on a 32-bit…
Jason Block
  • 155
  • 1
  • 2
  • 9
0
votes
2 answers

Unsigned long long arithmetic into double

I'm making a function that takes in 3 unsigned long longs, and applies the law of cosines to find out if the triangle is obtuse, acute or a right triangle. Should I just cast the variables to doubles before I use them? void triar( unsigned long…
Painguy
  • 527
  • 6
  • 13
  • 24