Yoda
Yoda

Reputation: 18068

Is the construction unsigned long long permitted?

Is the construction unsigned long long permitted? And is there anything like unsigned long double?

Upvotes: 0

Views: 134

Answers (3)

bash.d
bash.d

Reputation: 13207

According to this here, there is aunsigned long long but only in C++ 11. About unsigned long double I am not sure.
Check out the reference,

Upvotes: 0

Cody Gray
Cody Gray

Reputation: 244722

Yes, unsigned long long is permitted because it declares a variable of type long long that is also unsigned. The unsigned keyword can be applied to any integer type, and long long is indeed an integer type.

There is no such thing as unsigned long double because long double is a floating point type (as opposed to an integer type), and there is no such thing as unsigned floating point types (reference 1, reference 2).

Upvotes: 4

us2012
us2012

Reputation: 16253

unsigned long long is fine. (Technically, it's been around since C99, but only since C++11, but every major C++ compiler has been implementing it for quite a long time already.)

There is no such thing as unsigned long double. Floating point types (at least those available in any language I can think of, and certainly those described by IEEE754 and the C standard) are always signed.

Upvotes: 4

Related Questions