;; | --------------------------------------------------------------------------- ;; | MI_hx+hx ;; | --------------------------------------------------------------------------- ;; | Function : HX+HX accepts two hexadecimal strings as arguments and returns ;; | their sum as a hexadecimal string. ;; | Arguments : 'str - First Hexadecimal String ;; | 'str2 - Second Hexadecimal String ;; | Return : The sum hexadecimal string ;; | Update : August 6, 1998 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun MI_hx+hx (str str2 / lst) (setq str (strcat "0" str) ;add leading 0 for single char str2 (strcat "0" str2) ;hex strings ) (setq lst (mapcar '+ (MI_hxlist str) (MI_hxlist str2))) ;breakdown into component (MI_listhx lst) ;powers of 16 and add ) ;convert back to hex