GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::numeric_limits::lowest(3) C++ Standard Libary std::numeric_limits::lowest(3)

std::numeric_limits::lowest - std::numeric_limits::lowest


static constexpr T lowest() noexcept; (since C++11)


Returns the lowest finite value representable by the numeric type T, that is, a
finite value x such that there is no other finite value y where y < x. This is
different from std::numeric_limits<T>::min() for floating-point types. Only
meaningful for bounded types.


T std::numeric_limits<T>::lowest()
/* non-specialized */ (C++11) T()
bool (C++11) false
char (C++11) CHAR_MIN
signed char (C++11) SCHAR_MIN
unsigned char (C++11) 0
wchar_t (C++11) WCHAR_MIN
char8_t (C++20) 0
char16_t (C++11) 0
char32_t (C++11) 0
short (C++11) SHRT_MIN
unsigned short (C++11) 0
int (C++11) INT_MIN
unsigned int (C++11) 0
long (C++11) LONG_MIN
unsigned long (C++11) 0
long long (C++11) LLONG_MIN
unsigned long long (C++11) 0
float (C++11) -FLT_MAX
double (C++11) -DBL_MAX
long double (C++11) -LDBL_MAX


For every standard C++ floating-point type T std::numeric_limits<T>::lowest() ==
-std::numeric_limits<T>::max(), but this does not necessarily have to be the case
for any third-party specialization.


Demonstrates min, max, and lowest for floating-point types

// Run this code


#include <limits>
#include <iostream>
int main()
{


std::cout << "std::numeric_limits<T>::min():\n"
<< "\tfloat: " << std::numeric_limits<float>::min()
<< " or " << std::hexfloat << std::numeric_limits<float>::min() << '\n'
<< "\tdouble: " << std::defaultfloat << std::numeric_limits<double>::min()
<< " or " << std::hexfloat << std::numeric_limits<double>::min() << '\n';
std::cout << "std::numeric_limits<T>::lowest():\n"
<< "\tfloat: " << std::defaultfloat << std::numeric_limits<float>::lowest()
<< " or " << std::hexfloat << std::numeric_limits<float>::lowest() << '\n'
<< "\tdouble: " << std::defaultfloat << std::numeric_limits<double>::lowest()
<< " or " << std::hexfloat << std::numeric_limits<double>::lowest() << '\n';
std::cout << "std::numeric_limits<T>::max():\n"
<< "\tfloat: " << std::defaultfloat << std::numeric_limits<float>::max()
<< " or " << std::hexfloat << std::numeric_limits<float>::max() << '\n'
<< "\tdouble: " << std::defaultfloat << std::numeric_limits<double>::max()
<< " or " << std::hexfloat << std::numeric_limits<double>::max() << '\n';
}


std::numeric_limits<T>::min():
float: 1.17549e-38 or 0x1p-126
double: 2.22507e-308 or 0x1p-1022
std::numeric_limits<T>::lowest():
float: -3.40282e+38 or -0x1.fffffep+127
double: -1.79769e+308 or -0x1.fffffffffffffp+1023
std::numeric_limits<T>::max():
float: 3.40282e+38 or 0x1.fffffep+127
double: 1.79769e+308 or 0x1.fffffffffffffp+1023


min returns the smallest finite value of the given type
[static] (public static member function)
denorm_min returns the smallest positive subnormal value of the given floating-point
[static] type
(public static member function)
max returns the largest finite value of the given type
[static] (public static member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.