Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Math.erfc

(::Math::double x) -> ::Float
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 .expm1 also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0