{"id":25383,"date":"2021-11-10T09:38:32","date_gmt":"2021-11-10T04:08:32","guid":{"rendered":"https:\/\/python-programs.com\/?p=25383"},"modified":"2021-11-10T09:38:32","modified_gmt":"2021-11-10T04:08:32","slug":"python-math-erf-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-math-erf-method-with-examples\/","title":{"rendered":"Python math.erf() Method with Examples"},"content":{"rendered":"

math.erf() Method in Python:<\/strong><\/p>\n

The math.erf() method returns a number’s error function.<\/p>\n

This method accepts values ranging from – inf to + inf and returns a value ranging from – 1 to + 1.<\/p>\n

Syntax:<\/strong><\/p>\n

math.erf(x)<\/pre>\n

Parameters<\/strong><\/p>\n

x:<\/strong> This is Required. It is a number used to calculate the error function of<\/p>\n

Return Value:<\/strong><\/p>\n

Returns a float value that represents a number’s error function.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Number = 0.5<\/pre>\n

Output:<\/strong><\/p>\n

The given number's { 0.5 } error function =  0.5204998778130465<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Number = -4.5<\/pre>\n

Output:<\/strong><\/p>\n

The given number's { -4.5 } error function =  -0.9999999998033839<\/pre>\n

math.erf() Method with Examples in Python<\/h2>\n