8 AutoLisp Programming : Structure Functions


=============================================

1 AutoLisp Programming : Introduction

2 AutoLisp Programming : Basic Knowledge Essentials

3 AutoLisp Programming : DataTypes

4 AutoLisp Programming : Arithmetic Functions

5 AutoLisp Programming : Trignometric Functions

6 AutoLisp Programming : Mathematical Functions

7 AutoLisp Programming : Exercise 01

8 AutoLisp Programming : Structure Functions

9 AutoLisp Programming : All Commands

=============================================

AutoLisp Structure Functions

 

Structure functions:


Function : “abs” (absolute)
Description: Returns the absolute value of the (unsigned magnitude) of a number.
Syntax: (abs <number>)
Example 1: (abs -4) result will be 4
Example 2: (abs 25) result will be 25


Function : “rem” (remainder)
Description: Returns the remainder of two dividing number <num1> by <num2>. If more than two agruments are passed then the remainder of FIRST and SECOND will be divided by the THIRD and the value is returned..
Syntax: (rem <num1> <num2> )
Example1: (rem 5 4.0) result will be 1
Example2: (rem 20 7 4) result will be 2 Explaination (rem (rem 20 7) 4))


Function : “gcd” (greatest common denominator)
Description: This function returns the Gretest common Divisor of <num1> and <num2>, both the numbers should be integer.
Syntax: (gcd <num1><num2>)
Example1: (gcd 21 12) result will be 3
Example2: (gcd 20 24) result will be 4


Function : “sqrt” (square root)
Description: This function returns the square root of the number as a real number.
Syntax: (sqrt <num1>)
Example1: (sqrt 25) result will be 5
Example2: (sqrt 2025.0) result will be 45.0


Function : “min” (minimum)
Description: This function returns the smallest of the numbers given
Syntax: (min <num1><num2> )
Example1: (min 5 8 2 5) result will be 2
Example2: (min -4 1.5 -0.5) result will be -4.0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s