;;Realis of complex number z (def rez (z) (with (lz (tocons z) i 0 j 0) (until (or (is i (len lz)) (and (isnt (lz j) #\e) (or (is (lz i) #\+) (is (lz i) #\-)))) (if (is i 0) (++ i) (do (++ i) (++ j)))) (toint (firstn i lz)))) ;;Imaginaris of complex number z (def imz (z) (with (lz (tocons z) i 0 j 0) (until (or (is i (len lz)) (and (isnt (lz j) #\e) (or (is (lz i) #\+) (is (lz i) #\-)))) (if (is i 0) (++ i) (do (++ i) (++ j)))) (toint (if (pos #\i lz) (rem #\i (nthcdr i lz)) 0))))