Welcome to My Public Vault

Home

❯

整数昇格

整数昇格

Apr 15, 20261 min read

  • CPlusPlus

integral promotion。

  • signed char型・signed short型はint型(C++)に変換できる。
  • unsigned char型・char8_t型・unsigned short型は、int型(C++)がそれらの範囲を値を保持できるならint型(C++)に変換できる。保持できないならunsigned int型(C++)に変換する。
  • bool型(C++)はint型(C++)に変換できる(trueは1、falseは0に対応する。)

参考

  • https://www.learncpp.com/cpp-tutorial/floating-point-and-integral-promotion/

Graph View

Backlinks

  • 数値昇格

Created with Quartz v4.5.2 © 2026

  • GitHub
  • Discord Community