Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 561 Bytes

ldiv_t.md

File metadata and controls

41 lines (33 loc) · 561 Bytes

ldiv_t

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

概要

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

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

#include <iostream>
#include <cstdlib>

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

出力

2
1