Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 600 Bytes

lldiv_t.md

File metadata and controls

42 lines (34 loc) · 600 Bytes

lldiv_t

  • cstdlib[meta header]
  • std[meta namespace]
  • class[meta id-type]
  • cpp11[meta cpp]
namespace std {
  struct lldiv_t {
    long long quot;
    long long rem;
  };
}

概要

std::div()関数のlong long版の戻り値。

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

#include <iostream>
#include <cstdlib>

int main()
{
  std::lldiv_t x = std::div(5LL, 2LL);
  std::cout << x.quot << std::endl;
  std::cout << x.rem << std::endl;
}
  • std::lldiv_t[color ff0000]
  • std::div[link div.md]

出力

2
1