#### cfleck

##### tired

I need to be able to to various operations on said unit like bit shifting and the like. The problem is, 32 bits isn't even close to what I need. Any ideas on how to go about it?

- Thread starter cfleck
- Start date

We don't like Ads much either, but they do help cover the costs of running the site. Please consider turning off your ad blocker. Thank you.

I need to be able to to various operations on said unit like bit shifting and the like. The problem is, 32 bits isn't even close to what I need. Any ideas on how to go about it?

Is double equivalent to long or long long?

If I was to have an 'unsigned double' data type what would happen if it got sent a negative value, does it default to zero or just give out an error?

When you use signed integers (chars, shorts, ints, longs), the last bit (the most significant bit) is reserved to represent negative or positive for the number. When using unsigned integers, this bit is used to store the number like normal. So if you don't need negative numbers, use unsigned integers because you can store 2x as many values in the same amount of bits.

For example, a char is 8 bits. So is an unsigned char. But an unsigned char can hold values up to 2^8-1, but signed chars can only hold values up to 2^7-1 because the last bit is reserved for negative or positive (0=positive, 1=negative). This doesn't make much different with today's average desktop or laptop computers, but if you're working in embedded systems where your memory is limited, or working with binary files where every bit is important, you need to know the difference.

Oh, and doubles don't have unsigned or signed. Only integers do.

How many decimal places do you need to calculate to?

What are you doing?

What are you doing?

You'd have to split it up into chunks and then work with it.