Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Math.erfc

Math.erfc(x) → Float

Returns the value of the complementary error function for x.

  • Domain: [-INFINITY, INFINITY].

  • Range: [0, 2].

Examples:

Example
erfc(-INFINITY) # => 2.0
erfc(0.0)       # => 1.0
erfc(INFINITY)  # => 0.0

Related: Math.erf.

See also .erf .exp .cosh .frexp also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0