Learn R Programming

PracTools (version 1.6)

quad_roots: Compute the roots of a quadratic equation

Description

Compute the roots of a quadratic equation

Usage

quad_roots(a, b, c)

Value

vector with the two roots

Arguments

a

coefficient of the quadratic term

b

coefficient of the linear term

c

coefficient of the constant term

Details

quad_roots computes the roots of a quadratic equation of the form \(ax^2 + bx + c = 0\).

Examples

Run this code
    quad_roots(1, -8, 12)

Run the code above in your browser using DataLab