VOOZH about

URL: https://www.geeksforgeeks.org/cpp/std-is_floating_point-template-in-c/

⇱ std is_floating_point Template in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

std is_floating_point Template in C++

Last Updated : 19 Nov, 2018
The std::is_floating_point template of C++ STL is used to check whether the given type is a floating point value or not. It returns a boolean value showing the same. Syntax:
template < class T > struct is_floating_point;
Parameter: This template accepts a single parameter T (Trait class) to check whether T is a floating point type. Return Value: This template returns a boolean value as shown below:
  • True: if the type is a float.
  • False: if the type is a not float value.
Below programs illustrate the std::is_floating_point template in C++ STL: Program 1:
Output:
is_floating_point:
char: false
int: false
float: true
Program 2:
Output:
is_floating_point:
double: true
bool: false
long int: false
Program 3:
Output:
is_floating_point:
wchar_t: false
long double: true
unsigned short int: false
Comment
Article Tags: