ratio_less() function in C++ Last Updated : 26 Jul, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The ratio_less() is an inbuilt function in C++ which checks if the ratio R1 is less than the ratio R2. It returns True if the ratio is less than ratio 2, else it returns false. Syntax: template < class ratio1_name, class ratio2_name > ratio_less 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 ratio2 otherwise it returns false. Below programs illustrates the above function: Program 1: CPP // C++ program to illustrate the // ratio_less function #include <iostream> #include <ratio> using namespace std; int main() { typedef ratio<3, 9> ratio1; typedef ratio<1, 3> ratio2; // check if R1<R2 if (ratio_less<ratio1, ratio2>::value) cout << "3/9 is less than 1/3"; else cout << "3/9 is not less than 1/3"; return 0; } Output: 3/9 is not less than 1/3 Program 2: CPP // C++ program to illustrate the // ratio_less function #include <iostream> #include <ratio> using namespace std; int main() { typedef ratio<1, 2> ratio1; typedef ratio<4, 7> ratio2; // check if R1<R2 if (ratio_less<ratio1, ratio2>::value) cout << "1/2 is less than 4/7"; else cout << "1/2 is not less than 4/7"; return 0; } Output: 1/2 is less than 4/7 Comment More infoAdvertise with us Next Article ratio_greater_equal() function in C++ T Twinkl Bajaj Follow Improve Article Tags : Misc C++ STL CPP-Library CPP-Functions cpp-ratio +2 More Practice Tags : CPPMiscSTL Similar Reads ratio_less_equal() function in C++ 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. Syntax: template < class ratio1_name, class ratio2_name > ratio_less_equal Template Par 2 min read log() Function in C++ The std::log() in C++ is a built-in function that is used to calculate the natural logarithm (base e) of a given number. The number can be of any data type i.e. int, double, float, long long. It is defined inside the <cmath> header file.In this article we will learn about how to use std::log() 1 min read ratio_greater() function in C++ The ratio_greater() is an inbuilt function in C++ which checks if the ratio R1 is greater than the ratio R2. It returns True if the ratio is greater than ratio 2, else it returns false. Syntax: template ratio_greater Template Parameters The function accepts two template parameters ratio1 and ratio2 2 min read lldiv() function in C++ STL The lldiv() is a builtin function in C++ STL which gives us the quotient and remainder of the division of two numbers. Syntax: lldiv(n, d) Parameters: The function accepts two mandatory parameters which are described below: n: It specifies the dividend. The data-type can be long long or long long in 2 min read ratio_greater_equal() function in C++ The ratio_greater_equal() is an inbuilt function in C++ which checks if the ratio R1 is greater than or equal to the ratio R2. It returns True if the ratio is greater than or equal to ratio 2, else it returns false. Syntax: template ratio_greater_equal Template Parameters The function accepts two te 2 min read set::lower_bound() Function in C++ STL The std::set::lower_bound() method is used to find the first element in the set that is equal to or greater than the given value. It is a member function of std::set class and is defined inside <set> header file. In this article, we will learn about std::set::lower_bound() function in C++.Exam 3 min read Like