Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- solvequad = [
- if (>=f (-f (pow $arg2 2) (*f 4 (*f $arg1 $arg3)))) [
- result (concat (divf (-f (sqrt (-f (pow $arg2 2) (*f 4 (*f $arg1 $arg3)))) $arg2) (*f 2 $arg1)) (divf (+f $arg2 (sqrt (-f (pow $arg2 2) (*f 4 (*f $arg1 $arg3))))) (*f -2 $arg1)))
- ] [
- sq_real = (divf $arg2 (*f -2 $arg1))
- sq_im = (divf (sqrt (-f (*f 4 (*f $arg1 $arg3)) (pow $arg2 2))) (*f 2 $arg1))
- result (concatword (? (=f $sq_real) "0.0" $sq_real) (? (>=f $sq_im) "+" "-") $sq_im "i " (? (=f $sq_real) "0.0" $sq_real) (? (<f $sq_im) "+" "-") $sq_im "i")
- ]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement