Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

ProcedureExample_QauadraticFormula





proc qf {a b c} {
    if {$a == 0} {error "Denominator can not be zero"}
    set s [expr sqrt($b*$b-4*$a*$c)]
    set d [expr 2*$a]
    list [expr (-$b+$s)/$d] \
         [expr (-$b-$s)/$d]
}


qf 1 0 -2

catch {qf 0 0 -2} roots
set roots

puts $roots


Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.