Obtain minimum NEGATIVE float value in C++

前端 未结 3 1771
猫巷女王i
猫巷女王i 2021-02-05 03:04

I was looking at std::numeric_limits::min/max() but it appears \'min()\' returns the smallest absolute value, not the lowest value. Is it safe

3条回答
  •  心在旅途
    2021-02-05 03:29

    use std::numeric_limits::lowest()

    static _Ty __CRTDECL lowest() _THROW0()
        {   // return most negative value
        return (-(max)());
        }
    

提交回复
热议问题