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

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
  • 10,734
  • 21
  • 104
  • 218
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
  • 3,210
  • 5
  • 32
  • 57
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,840
  • 36
  • 123
  • 208
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
  • 438
  • 7
  • 24
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
  • 3
  • 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
  • 565
  • 6
  • 13
  • 25
0
votes
2 answers

Dynamic Programming Issue - Fibonacci Sequence

I was reading this Wikipedia article, and attempting to implement a 'map' based solution in C, where a 'map' is just an int array, initialized to 0. For some reason it works up to fib(93), then starts outputting strange numbers. If it matter's I'm…
Josh
  • 12,448
  • 10
  • 74
  • 118
-1
votes
1 answer

How to convert unsigned long long to float/int in C?

An unsigned long long variable has the value of "40 36 70 A3 D7 0A 3D 71" in hex. If I print it with the %fconversion specifier I get the right conversion from IEEE-754. How can I cast this variable to a floating one or int, even if I lose some…
-1
votes
1 answer

Massive performance slowdown when changing int to unsigned long long in segmented sieve

I'm confused about the performance of my C program that implements a Segmented Sieve. I originally used only int as the datatype but to support bigger numbers I decided to switch to unsigned long long. I expected some performance penalty due to…
Chase
  • 5,315
  • 2
  • 15
  • 41
-1
votes
1 answer

Maximum Value for Unsigned Int is it -1

I was trying to figure out the minimum and maximum value for an unsigned data type. I know that the minimum unsigned value is 0 and the maximum value is (2^n)-1. However, when I tried to run my program (I cannot post my code, but you can refer to…
eLg
  • 519
  • 4
  • 11
  • 25
-1
votes
1 answer

The mod function isn't working properly for me

When I input 36011 it results in the second(s) output being 36011 instead of 11, I made sure the compiler settings were set correctly and everything. I genuinely don't know what else to do, I have to use long long int for this assignment and it's…
Ethan
  • 1
1 2 3
10
11