Satish Lele
satish.lele@gmail.com


Number Function

+ A plus operator is a plus sign as first item in a list followed by a number of numbers. These can be integers or real numbers. Its return value is the result of the addition. If you supply only one number argument, this function returns the result of adding it to zero. If you supply no arguments, the function returns 0.
- A minus operator is a minus sign as first item in a list followed by a number of numbers. These can be integers or real numbers. The result is the subtraction. If you supply more than two number arguments, this function returns the result of subtracting the sum of the second through the last numbers from the first number. If you supply only one number argument, this function subtracts the number from zero, and returns a negative number. Supplying no arguments returns 0.
* A multiplication operator is a star sign as first item in a list followed by a number of numbers. These can be integers or real numbers. The result is the multiplication of all the numbers. If you supply only one number argument, this function returns the result of multiplying it by one; it returns the number. Supplying no arguments returns 0.
/ A division operator is a slash sign as first item in a list followed by a number of numbers. These can be integers or real numbers. The result is the division. If you supply more than two number arguments, this function divides the first number by the product of the second through the last numbers, and returns the final quotient. If you supply one number argument, this function returns the result of dividing it by one; it returns the number. Supplying no arguments returns 0.
1+ (increment): Returns the argument increased by 1 (incremented). (1+ number). (1+ 5) returns 6. (1+ -17.5) returns -16.5
1- (decrement): Returns the argument reduced by 1 (decremented). (1- number). (1- 5) returns 4. (1- -17.5) returns -18.5
abs: Returns the absolute value of the argument. (abs number). (abs 100) returns 100. (abs -100) returns 100. (abs -99.25) returns 99.25.
exp: Returns the constant e (a real) raised to a specified power (the natural antilog). (exp num). (exp 1.0) returns 2.71828. (exp 2.2) returns 9.02501. (exp -0.4) returns 0.67032
expt: Returns a number raised to a specified power. (expt number power). If both arguments are integers, the result is an integer. Otherwise, the result is a real. (expt 2 4) returns 16. (expt 3.0 2.0) returns 9.0
fix: Returns the conversion of a real into the nearest smaller integer. (fix num). The fix function truncates number to the nearest integer by discarding the fractional portion. (fix 3) returns 3. (fix 3.7) returns 3. Note If number is larger than the largest possible integer (+2,147,483,647 or -2,147,483,648 on a 32-bit platform), fix returns a truncated real (although integers transferred between AutoLISP and AutoCAD are restricted to 16-bit values).
float: Returns the conversion of a number into a real. (float num). (float 3) returns 3.0. (float 3.75) returns 3.75
rem: Divides the first number by the second, and returns the remainder. (rem number number...). If more than two numbers are provided, rem divides the result of dividing the first number by the second with the third, and so on. (rem 42 12) returns 6. (rem 12.0 16) returns 12.0. (rem 26 7) returns 5. (rem 5 2) returns 1. (rem 26 7 2) returns 1.
sqrt: Returns the square root of a number as a real. (sqrt num). (sqrt 4) returns 2.0. (sqrt 2.0) returns 1.41421
backBack top