• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    variable
    <limits>

    std::numeric_limits::min_exponent10

    // C++03
    static const int min_exponent10;
    
    // C++11
    static constexpr int min_exponent10;
    

    概要

    浮動小数点数型において、型Tの指数下限値を得る。
    基数10をmin_exponentの値で累乗した値が、型Tで表現可能な正規化された値となる最小の負の値。
    浮動小数点数型以外は0になる。

    対応するマクロを次の表に挙げる。

    対応するマクロ
    float FLT_MIN_10_EXP
    double DBL_MIN_10_EXP
    long double LDBL_MIN_10_EXP

    #include <iostream>
    #include <limits>
    
    int main()
    {
      constexpr int f = std::numeric_limits<float>::min_exponent10;
      constexpr int d = std::numeric_limits<double>::min_exponent10;
    
      std::cout << "float : " << f << std::endl;
      std::cout << "double : " << d << std::endl;
    }
    

    出力

    float : -37
    double : -307
    

    参照