Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 939 Bytes

File metadata and controls

58 lines (41 loc) · 939 Bytes

max

  • random[meta header]
  • std[meta namespace]
  • independent_bits_engine[meta class]
  • function[meta id-type]
  • cpp11[meta cpp]
static constexpr result_type max();

概要

生成し得る値の最大値を取得する。

戻り値

最大値である2w -1を返す。

計算量

定数時間

#include <iostream>
#include <random>

int main()
{
  using engine_type = std::independent_bits_engine<std::mt19937, 64, std::uint64_t>;

  std::uint64_t max_value = engine_type::max();
  std::cout << max_value << std::endl;
}
  • max()[color ff0000]
  • std::uint64_t[link /reference/cstdint/uint64_t.md]

出力

18446744073709551615

バージョン

言語

  • C++11

処理系

参照