Advertisement
messimmous

MyPasteTitle

May 27th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. (defun kvd (a b c) ( discr a b c )  ( cond
  2.     (( > ( discr a b c ) 0 ) (korn a b c))
  3.     (( = ( discr a b c ) 0 ) (korn2 a b) )
  4.     ( T 0)
  5.     )
  6.  )    
  7.  (defun discr (a b c)
  8.     (- (* b b) (* 4 a c))
  9.  )
  10.  
  11.  (defun korn (a b c)
  12.     (/(- ( * -1 b) (discr a b c)) (* 2 a))
  13.     (/(+ ( * -1 b) (discr a b c)) (* 2 a))
  14.  )
  15.  
  16.  (defun korn2 (a b)
  17.     (/(* -1 b) (* 2 a))
  18.  )
  19.  
  20. (print ( kvd 1 2 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement