最終更新日時(UTC):
が更新

履歴 編集

macro
<cmath>

FP_INFINITE(C++11)

# define FP_INFINITE integer_constant_expression

概要

浮動小数点数が(正または負の)無限大であることを表す整数定数式。

備考

このマクロの値は、std::fpclassify において、引数が正、あるいは、負の無限大である場合に、戻り値として使用される。

#include <iostream>
#include <limits>
#include <cmath>

int main()
{
  std::cout << std::boolalpha;
  std::cout << (std::fpclassify(std::numeric_limits<double>::infinity()) == FP_INFINITE) << std::endl;
}

出力例

true

バージョン

言語

  • C++11