ratio_not_equal() in C++ with examples Last Updated : 20 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The ratio_not_equal is an inbuilt function in C++ STL that checks if two given ratios are not equal or equal. Syntax: template < class ratio1_name, class ratio2_name > ratio_not_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 not equal otherwise it returns false. Time Complexity: O(1) Auxiliary Space: O(1) Program below demonstrates the function: Program 1: CPP // C++ program to illustrate the // ratio_not_equal function #include <iostream> #include <ratio> using namespace std; int main() { typedef ratio<3, 9> ratio1; typedef ratio<1, 3> ratio2; // If both the ratios are not same if (ratio_not_equal<ratio1, ratio2>::value) cout << "Both ratio are not equal"; else cout << "Both ratio are equal"; return 0; } Output:Both ratio are equal Program 2: CPP // C++ program to illustrate the // ratio_equal function #include <iostream> #include <ratio> using namespace std; int main() { typedef ratio<1, 2> ratio1; typedef ratio<5, 4> ratio2; // If both the ratios are not same if (ratio_not_equal<ratio1, ratio2>::value) cout << "Both ratio are not equal"; else cout << "Both ratio are equal"; return 0; } Output:Both ratio are not equal Comment More infoAdvertise with us Next Article ratio_equal() in C++ with examples T Twinkl Bajaj Follow Improve Article Tags : Misc C++ STL CPP-Library CPP-Functions cpp-template cpp-ratio +3 More Practice Tags : CPPMiscSTL Similar Reads ratio_equal() in C++ with examples The ratio_equal() is an inbuilt function in C++ STL that checks if two given ratios are equal or not. Syntax: 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 1 min read std::mismatch() with examples in C++ C++ STL has lots of useful functions that helps us to achieve various programming tasks. One such function is "mismatch()" . This function, defined in "algorithm" header file, helps to compare 2 containers for mismatches. This function has 2 versions. Both are discussed in this article. mismatch( st 4 min read std::is_nothrow_assignable in C++ with Examples The std::is_nothrow_assignable template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_assignable template of C++ STL is used to check whether A is type assignable to B or not and this is known for not to throw any exception. It return the boolean value true if A i 3 min read std::is_same template in C++ with Examples The std::is_same template of C++ STL is present in the <type_traits> header file. The std::is_same template of C++ STL is used to check whether the type A is same type as of B or not. It return the boolean value true if both are same, otherwise return false. Header File: #include<type_trait 3 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 std::is_nothrow_copy_assignable in C++ with Examples The std::is_nothrow_copy_assignable template of C++ STL is present in the <type_traits> header file. The std::is_nothrow_copy_assignable template of C++ STL is used to check whether T is copy assignable type or not and this is known for not to throw any exception. It returns the boolean value 2 min read Like