最終更新日時:
が更新

履歴 編集

class
<cinttypes>

std::imaxdiv_t(C++11)

namespace std {
  struct imaxdiv_t {
    intmax_t quot;
    intmax_t rem;
  };
}

概要

std::imaxdiv()関数の戻り値となる構造体型。

quotは「quotient (商)」、remは「remainder (剰余)」を表す。

なお、メンバの宣言順序は未規定である。

#include <iostream>
#include <cinttypes>

int main()
{
  std::imaxdiv_t x = std::imaxdiv(17, 5);
  std::cout << x.quot << std::endl;
  std::cout << x.rem << std::endl;
}

出力

3
2

バージョン

言語

  • C++11

関連項目

参照