0

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

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Yoda
  • 17,363
  • 67
  • 204
  • 344

3 Answers3

4

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.

us2012
  • 16,083
  • 3
  • 46
  • 62
4

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).

Community
  • 1
  • 1
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
0

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,

bash.d
  • 13,029
  • 3
  • 29
  • 42
  • ... yeah, but it's been in C since `C99` and every major C++ compiler has been implementing it for years even though it wasn't in the standard until `C++11`. – us2012 Mar 10 '13 at 13:27