The ratio_equal() is an inbuilt function in C++ STL that checks if two given ratios are equal or not.
template < class ratio1_name, class ratio2_name > ratio_equal
Template Parameters: The function accepts two template parameters ratio1 and ratio2 which are to be compared.
Return value: The function returns true if the ratios are equal otherwise it returns false.
Below programs illustrate the ratio_equal() function:
Both ratio are equal
Both ratio are not equal
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- cin get() in C++ with Examples
- Pi(π) in C++ with Examples
- std::less in C++ with Examples
- C/C++ while loop with Examples
- ratio_not_equal() in C++ with examples
- C/C++ if else if ladder with Examples
- C/C++ if else statement with Examples
- wmemset() in C/C++ with Examples
- std::greater in C++ with Examples
- C/C++ do while loop with Examples
- C/C++ if statement with Examples
- std::allocator() in C++ with Examples
- ios bad() function in C++ with Examples
- SDL library in C/C++ with examples
- std::bit_or in C++ with Examples