Python - cmath.isclose() function Last Updated : 28 May, 2020 Comments Improve Suggest changes Like Article Like Report cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.isclose() function is used to check whether two complex values are close, or not. The value passed in this function can be int, float, and complex numbers. Syntax: cmath.isclose(a, b, rel_tol = value, abs_tol = value) Parameter:This method accepts the following parameters. a :This parameter is the first value to check for closeness.b :This parameter is the second value to check for closeness.rel_tol = value :This parameter is the maximum allowed difference between value a and b.abs_tol = value : This parameter is the minimum absolute tolerance Returns:This method returns a Boolean value. Below examples illustrate the use of above function: Example #1 : Python3 # Python code to implement # the isclose()function # importing "cmath" # for mathematical operations import cmath # using cmath.isclose() method val = cmath.isclose(1 + 2j, 1 + 2j) print(val) val1 = cmath.isclose(1 + 2.2j, 1 + 2j) print(val1) Output: True False Example 2: Python3 # Python code to implement # the isclose()function # importing "cmath" # for mathematical operations import cmath # using cmath.isclose() method val = cmath.isclose(1 + 2j, 1 + 2j, abs_tol = 0.5) print(val) val1 = cmath.isclose(1 + 2.2j, 1 + 2j, abs_tol = 0.5) print(val1) Output: True True Comment More infoAdvertise with us Next Article Python - cmath.isclose() function S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python math-library-functions Python Cmath-library Practice Tags : python Similar Reads Python - cmath.isnan() function cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.isnan() function is used to check whether the value is nan (Not a Number), or not. The value passed in this function can be int, float, and complex numbers. Syntax: cmath.isnan(x) Par 1 min read Python - cmath.isinf() function cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.isinf() function is used to check whether the value is positive or negative infinity, or not. The value passed in this function can be int, float, and complex numbers. Syntax: cmath.i 1 min read Python - cmath.isfinite() function cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.isfinite() function is used to check whether the value is finite, or not. The value passed in this function can be int, float, and complex numbers. Syntax: cmath.isfinite(x) Parameter 1 min read cmp() function - Python cmp() method in Python 2.x compares two integers and returns -1, 0, 1 according to comparison. cmp() does not work in python 3.x. You might want to see list comparison in Python.ExamplePython# Example 1 print(cmp(3, 4)) # Example 2 print(cmp(5, 5)) # Example 3 print(cmp(7, 6)) Output-101ExplanationI 3 min read wxPython | Exit() function in wxPython In this article we are going to learn about wx.Exit() which is a inbuilt parent function present in wxPython.Exit() function exits application after calling wx.App.OnExit . Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to termin 1 min read Like