0 Members and 1 Guest are viewing this topic.
this works in my hungover brain:(apply '- (mapcar '- (list a b)))
(defun _+ ( a b / temp ) (while (< 0 b) (setq temp (logand a b) a (boole 6 a b) b (lsh temp 1) ) ) a )
This may work for positive ints:Code: [Select](defun _+ ( a b / temp ) (while (< 0 b) (setq temp (logand a b) a (boole 6 a b) b (lsh temp 1) ) ) a )
(defun _+ ( a b ) (defun foo ( a b c / x y ) (cond ( (= 0 a b) c) ( (setq x (boole 1 1 a) y (boole 1 1 b) ) (logior (boole 6 c (boole 6 x y)) (lsh (foo (lsh a -1) (lsh b -1) (logior (boole 1 c x) (boole 1 c y) (boole 1 x y) ) ) 1 ) ) ) ) ) (foo a b 0))
(defun _+ (a b) (repeat a (setq b (1+ b))))
(defun _+ (a b) (if (> a 0) (repeat a (setq b (1+ b))) (repeat (abs a) (setq b (1- b))) ))
(defun _+ ( a b ) (distance (list 0 0) (polar (list a 0) 0 b)))
(defun _+ ( a b ) (car (polar (list a 0) 0 b)))
Here is:Code: [Select](defun _+ (a b) (if (> a 0) (repeat a (setq b (1+ b))) (repeat (abs a) (setq b (1- b))) ))
oops i was dumb Code: [Select](defun _+ ( a b ) (car (polar (list a 0) 0 b)))
(defun _+ ( a b / r s ) (if (setq s (vla-getinterfaceobject (vlax-get-acad-object) "scriptcontrol")) (progn (setq r (vl-catch-all-apply '(lambda nil (vlax-put-property s 'language "vbscript") (vlax-invoke s 'eval (strcat (itoa a) "+" (itoa b))) ) ) ) (vlax-release-object s) (if (not (vl-catch-all-error-p r)) r) ) ))
(defun _+ ( a b ) (log (* (exp a) (exp b))))
(defun _+ ( a b ) (- (1- a) (~ b)))
Code: [Select](defun _+ ( a b ) (car (polar (list a 0) 0 b)))
Another simple math trick:Code: [Select](defun _+ ( a b ) (log (* (exp a) (exp b))))