The ratio_less_equal() is an inbuilt function in C++ which checks if the ratio R1 is less than or equal to the ratio R2. It returns True if the ratio is less than or equal to ratio 2, else it returns false.
template < class ratio1_name, class ratio2_name > ratio_less_equal
Template Parameters The function accepts two template parameters ratio1 and ratio2 which are to be compared.
Return value: The function returns a boolean value which is true if the ratio1 is less than or eqaul to the ratio2 otherwise returns false.
Below programs illustrates the above function:
3/9 is less than or equal to 1/3
1/3 is less than or equal to 1/2
1/8 is greater than 1/10
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between user defined function and library function in C/C++
- How to call some function before main() function in C++?
- Function Overloading vs Function Overriding in C++
- How to call function within function in C or C++
- Difference between Virtual function and Pure virtual function in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- fma() function in C++
- exp() function C++
- log() function in C++
- wcstok() function in C++ with example
- wcsncpy() function in C++ with example
- wcsstr() function in C++ with example
- real() function in C++
- imag() function in C++
- regex_iterator() function in C++ STL
- map key_comp() function in C++ STL
- max() function for valarray in C++
- valarray cos() function in C++
- valarray exp() function in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.