;; | -------------------------------------------------------------------- ;; | MI_ceilR ;; | -------------------------------------------------------------------- ;; | Function : Finds the ceiling of a real number value to the nearest ;; | multiple. ;; | Argument : val - Value to be rounded off to the nearest ceiling ;; | (real number) ;; | mult - Multiple for rounding (real number) ;; | Return : The rounded ceiling value as a real number ;; | Update : January 5, 2003 ;; | Comments : This function can use both integer and real ;; | input arguments but always returns a real ;; | value. Handles negative numbers also ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | -------------------------------------------------------------------- (defun MI_ceilR(val mult / sign remD ) (if (not (zerop val)) (progn (setq sign (/ val (abs val)) remD (abs (rem val mult)) val (abs val) ) (if (not (zerop remD)) (setq val (+ val (- mult remD))) ) ) (setq sign 1.0) ) (float (* val sign)) )