Number Handling
 
 
 

AutoLISP provides functions for working with integers and real numbers. In addition to performing complex mathematical computations in applications, you can use the number-handling functions to help you in your daily use of AutoCAD. If you are drawing a steel connection detail that uses a 2.5" bolt that is 0.5" in diameter, how many threads are there if the bolt has 13 threads per inch? Use the * (multiplication) function at the Console prompt, as in the following example:

_$ (* 2.5 13)
32.5 

The arithmetic functions that have a number argument (as opposed to num or angle, for example) return different values if you provide integers or reals as arguments. If all arguments are integers, the value returned is an integer. However, if one or all the arguments are reals, the value returned is a real. To ensure your application passes real values, be certain at least one argument is a real.

_$ (/ 12 5)
2
_$ (/ 12.0 5)
2.4

A complete list of number-handling functions is in AutoLISP Function Synopsis under the heading Arithmetic Functions These functions are described in the AutoLISP Reference.