A little test:
(defun _+Lee1 ( a b ) (- a (- b)))
(defun _+MP1 ( a b ) (apply '- (mapcar '- (list a b))))
(defun _+MP2 ( a b / temp )
(while (< 0 b)
(setq
temp (logand a b)
a (boole 6 a b)
b (lsh temp 1)
)
)
a
)
(defun _+Lee2 ( 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 _+Ale1 (a b)
(if (> a 0)
(repeat a (setq b (1+ b)))
(repeat (abs a) (setq b (1- b)))
)
)
(defun _+VK1 ( a b ) (car (polar (list a 0) 0 b)))
(defun _+Lee3 ( 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 _+Lee4 ( a b ) (log (* (exp a) (exp b))))
(defun _+Lee5 ( a b ) (- (1- a) (~ b)))
(defun _+Stf1 (a b)
(if (= a b)
(* 2 a)
(/ (- (* a a) (* b b)) (- a b))
)
)
(defun _+Stf2 (a b)
(if (zerop a) b (* a (1+ (/ b a))))
)
(defun _+Lee6 ( a b )
(if (< 0 a) (_+Lee6 (lsh (logand a b) 1) (boole 6 a b)) b)
)
(defun _+Lee7 ( a b )
(cond
( (= a b 0) 0)
( (< 0 a) (1+ (_+Lee7 (1- a) b)))
( (_+Lee7 b a))
)
)
(defun _+Ale2 (a b)
((eval (read (chr 43))) a b)
)
(defun pbe_+ ( m n / f g )
(defun f ( a b c / x y z )
(cond
( c
(setq x (g (f (list c) (list (car b)) nil))
y (g (f (list (car a)) (list (car x)) nil))
z (g (f (list (cadr x)) (list (cadr y)) nil))
)
(strcat (f (cdr a) (cdr b) (car z)) (car y))
)
( (and (car a) (car b))
(setq x
(cdr
(assoc (mapcar 'atoi (vl-sort (list (car a) (car b)) '<))
'(
((0 0) "0") ((0 1) "1") ((0 2) "2") ((0 3) "3") ((0 4) "4")
((0 5) "5") ((0 6) "6") ((0 7) "7") ((0 "8") ((0 9) "9")
((1 1) "2") ((1 2) "3") ((1 3) "4") ((1 4) "5") ((1 5) "6")
((1 6) "7") ((1 7) "8") ((1 "9") ((1 9) "0" "1") ((2 2) "4")
((2 3) "5") ((2 4) "6") ((2 5) "7") ((2 6) "8") ((2 7) "9")
((2 "0" "1") ((2 9) "1" "1") ((3 3) "6") ((3 4) "7") ((3 5) "8")
((3 6) "9") ((3 7) "0" "1") ((3 "1" "1") ((3 9) "2" "1") ((4 4) "8")
((4 5) "9") ((4 6) "0" "1") ((4 7) "1" "1") ((4 "2" "1") ((4 9) "3" "1")
((5 5) "0" "1") ((5 6) "1" "1") ((5 7) "2" "1") ((5 "3" "1") ((5 9) "4" "1")
((6 6) "2" "1") ((6 7) "3" "1") ((6 "4" "1") ((6 9) "5" "1") ((7 7) "4" "1")
((7 "5" "1") ((7 9) "6" "1") ((8 "6" "1") ((8 9) "7" "1") ((9 9) "8" "1")
)
)
)
)
(strcat (f (cdr a) (cdr b) (cadr x)) (car x))
)
( (car a) (strcat (f (cdr a) b nil) (car a)))
( (car b) (strcat (f (cdr b) a nil) (car b)))
( "" )
)
)
(defun g ( a )
(reverse (mapcar 'chr (vl-string->list a)))
)
(atoi (f (g (itoa (min m n))) (g (itoa (max m n))) nil))
)
(defun _+MkD1 ( a b )
(if (= a 0) b (_+MkD1 (1- a) (1+ b))))
(defun _+Rib1 ( a b )
(cond
( (= a 0) b )
( (= b 0) a )
( (= a b) (* 2 a) )
( (< a b) (- (* 2 b) (- b a)) )
( (> a b) (- (* 2 a) (- a b)) )
)
)
(setq n1 1000000000 n2 2000000000)
(+ n1 n2) -1294967296
(_+Lee1 n1 n2) -1294967296
(_+MP2 n1 n2) 713973248
(_+Lee2 n1 n2) -1294967296
(_+Ale1 n1 n2) > too slow
(_+VK1 n1 n2) 3.0e+009
(_+Lee3 n1 n2) > errore: Errore di automazione.
(_+Lee4 n1 n2) 1.#INF
(_+Lee5 n1 n2) -1294967296
(_+Stf1 n1 n2) 0
(_+Stf2 n1 n2) -1294967296
(_+Lee6 n1 n2) 713973248
(_+Lee7 n1 n2) > Errore irrecuperabile ***
(_+Ale2 n1 n2) -1294967296
(pbe_+ n1 n2) 2147483647
(_+MkD1 n1 n2) > Errore irrecuperabile ***
(_+Rib1 n1 n2) -1294967296