All pastes #59517 Raw Edit

Someone

public text v1 · immutable
#59517 ·published 2006-05-29 06:44 UTC
rendered paste body
on *:TEXT:!quad *:#:{
  set %a $$2
  set %b $$3
  set %c $$4
  quad
}
alias quad {
  var %topp = $calc(-(%b) + ($sqrt($calc((%b)^2 - 4 * (%a) * (%c)))))
  var %root1 = $calc(%topp / (2*(%a)))
  var %topm = $calc(-(%b) - ($sqrt($calc((%b)^2 - 4 * (%a) * (%c)))))
  var %root2 = $calc(%topm / (2*(%a)))
  var %roots = ( $+ %root1 $+ , $+ %root2 $+ )  
  msg $chan %roots
  unset %a
  unset %b
  unset %c
}
;Only problem with this is that you cant enter the equation
;You enter 2 2 -4 for something to solve for 2x^2+2x-4
;Tomorrow i can work on a dialog version, i had one somewhere
;but i mustve lost it :) cya