static const int digits; static constexpr int digits;
Parameter: The function std::numeric_limits<T>::digits does not accept any parameter.
Return Value: The function std::numeric_limits<T>::digits returns the number of radix digits that the type can represent without loss of precision.
Below is the program to demonstrate std::numeric_limits<T>::digits in C++:
For int: 31 For float: 24 For double: 53 For long double: 64
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.
- Function Interposition in C with an example of user defined malloc()
- Buffer Overflow Attack with Example
- fseek() in C/C++ with example
- Writing first C++ program : Hello World example
- std::search_n with example in C++
- tellp() in file handling with c++ with example
- vector::crend() & vector::crbegin() with example
- tellg() function in C++ with example
- wcstok() function in C++ with example
- wcsstr() function in C++ with example
- wcsncpy() function in C++ with example
- forward_list::cend() in C++ STL with Example
- Difference between Private and Protected in C++ with Example
- std::is_destructible in C++ with Example
- std::is_nothrow_move_constructible in C++ with Example
- std::is_trivially_default_constructible in C++ with Example
- std::numeric_limits<T>::denorm_min() in C++ with Example
- std::remove_cv in C++ with Example
- std::underlying_type in C++ with Example
- Life cycle of Objects in C++ with Example
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.