Python Tutorial Python Advanced Python References Python Libraries

Python math - erfc() Function



The Python math.erfc() function returns the complementary error function of the argument. The complementary error function of x is defined as:

erfc function

Where, erf(x) is an error function. Error functions usually occur in probability, statistics and partial differential equation describing diffusion.

Complementary Error Function

Syntax

math.erfc(x)   

Parameters

x Required. Specify the value.

Return Value

Returns the complementary error function of the argument.

Example:

In the example below, erfc() function returns the complementary error function of the given value.

import math

print(math.erfc(0))
print(math.erfc(1))
print(math.erfc(2),"\n")

print(math.erfc(-0.1))
print(math.erfc(-1))
print(math.erfc(-2))

The output of the above code will be:

1.0
0.15729920705028513
0.004677734981047265 

1.1124629160182848
1.842700792949715
1.9953222650189528

❮ Python Math Module