Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::lcm

      From cppreference.com
      <cpp‎ |experimental
       
       
       
       
      Merged into ISO C++ The functionality described on this page was merged into the mainline ISO C++ standard as of 6/2016, seestd::lcm(since C++17)
      Defined in header<experimental/numeric>
      template<class M,class N>
      constexprstd::common_type_t<M, N> lcm( M m, N n);
      (library fundamentals TS v2)

      Computes the least common multiple of the integersm andn.

      Contents

      [edit]Parameters

      m, n - integer values

      [edit]Return value

      If eitherm orn is zero, returns zero. Otherwise, return the least common multiple of|m| and|n|.

      [edit]Remarks

      If eitherM orN is not an integer type, or if either is (possibly cv-qualified)bool, the program is ill-formed.

      The behavior is undefined if|m|,|n| or the least common multiple of|m| and|n| is not representable as a value of typestd::common_type_t<M, N>.

      [edit]Exceptions

      Throws no exceptions.

      [edit]See also

      constexpr function template returning the greatest common divisor of two integers
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/lcm&oldid=154975"

      [8]ページ先頭

      ©2009-2025 Movatter.jp