PrevUpHomeNext

Basic Types

N bits of unsigned integral types

Types:
can be constexpr: true
constexpr utx::u8 a = 0;
constexpr utx::u16 b = 1;
constexpr utx::u32 c = 2;
constexpr utx::u64 d = 3;
constexpr utx::umax e = 4;
Max Values:
utx::print(
	utx::u8_max,
	utx::u16_max,
	utx::u32_max,
	utx::u64_max,
	utx::umax_max
);
Min Values:

N bits of signed integral types

Types:
can be constexpr: true
constexpr utx::i8 a = -2;
constexpr utx::i16 b = -1;
constexpr utx::i32 c = 0;
constexpr utx::i64 d = 1;
constexpr utx::imax e = 2;
Max Values:
utx::print(
	utx::i8_max,
	utx::i16_max,
	utx::i32_max,
	utx::i64_max,
	utx::imax_max
);
Min Values:
utx::print(
	utx::i8_min,
	utx::i16_min,
	utx::i32_min,
	utx::i64_min,
	utx::imax_min
);

N bits of floating point types

Types:
can be constexpr: true
Notice:
[Note] Note
  • The number of bits are not guaranteed, it depends on operating system or toolchain environments.
  • utx::f32 must be guaranteed 32 bits by environment, otherwise using utx::f32 will cause it to refuse compiling.
  • utx::f64 is not guaranteed 64 bits, but must be greater or equal to utx::f32 bits.
  • utx::f128 is not guaranteed 128 bits, but must be greater or equal to utx::f64 bits.
  • utx::fmax must be greater or equal to utx::f128 bits.
constexpr utx::f32 f1 = -2.5;
constexpr utx::f32 f2 = 2.5;
constexpr utx::f64 f3 = -3.5;
constexpr utx::f128 f4 = 3.5;
constexpr utx::fmax f5 = -4.5;

Chars

Types:
can be constexpr: true
Values:
constexpr utx::c8 a = 'B';
constexpr utx::uc8 b = 'H';
constexpr utx::c8 c = 127;
constexpr utx::uc8 d = 255;
static_assert(utx::c8_bits == 8);

PrevUpHomeNext