سبع الليل Posted August 17, 2017 Posted August 17, 2017 hi guys how do you do in excel we write this function =ceiling (number; 05) for examble in autolisp what is the same function to do this ?? I.E : if i have a number ( 2.63) ... and i want the cad give it as ( 2.65) what must i use ?? i assumed i can use (ceiling 2.63 0.05) but it is bad function thank you and sorry for my bad english Quote
ReMark Posted August 17, 2017 Posted August 17, 2017 Rounding Functions in autolisp as presented by Lee Mac. http://lee-mac.com/round.html Quote
Lee Mac Posted August 17, 2017 Posted August 17, 2017 Consider the following function: ;; Round Up - Lee Mac ;; Rounds 'n' up to the nearest 'm' (defun LM:roundup ( n m ) (cond ((equal 0.0 (rem n m) 1e- n) ((< n 0) (- n (rem n m))) ((+ n (- m (rem n m)))) ) ) Example of usage: _$ (LM:roundup 2.61 0.05) 2.65 Quote
سبع الليل Posted August 22, 2017 Author Posted August 22, 2017 thank you alot you are awesome people Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.