XLISP >
XLISP 2.0 -
Contents -
Reference -
Previous |
Next
23 Arithmetic Functions
- truncate - truncates a floating point number to an integer
- float - converts an integer to a floating point number
- + - add a list of numbers
- - - subtract a list of numbers or negate a single number
- * - multiply a list of numbers
- / - divide a list of numbers
- 1+ - add one to a number
- 1- - subtract one from a number
- rem - remainder of a list of numbers
- min - the smallest of a list of numbers
- max - the largest of a list of numbers
- abs - the absolute value of a number
- gcd - compute the greatest common divisor
- random - compute a random number between 0 and n-1 inclusive
- sin - compute the sine of a number
- cos - compute the cosine of a number
- tan - compute the tangent of a number
- asin - compute the arcsine of a number
- acos - compute the arccosine of a number
- atan - compute the arctangent of a number
- expt - compute x to the y power
- exp - compute e to the x power
- sqrt - compute the square root of a number
- < - test for less than
- <= - test for less than or equal to
- = - test for equal to
- /= - test for not equal to
- >= - test for greater than or equal to
- > - test for greater than
- (truncate expr)
- truncates a floating point number to an integer
- expr - the number
returns - the result of truncating the number
- (float expr)
- converts an integer to a floating point number
- expr - the number
returns - the result of floating the integer
- ( + expr...)
- add a list of numbers
- expr - the numbers
returns - the result of the addition
- ( - expr...)
- subtract a list of numbers or negate a single number
- expr - the numbers
returns - the result of the subtraction
- ( * expr...)
- multiply a list of numbers
- expr - the numbers
returns - the result of the multiplication
- ( / expr...)
- divide a list of numbers
- expr - the numbers
returns - the result of the division
- (1+ expr)
- add one to a number
- expr - the number
returns - the number plus one
- (1- expr)
- subtract one from a number
- expr - the number
returns - the number minus one
- (rem expr...)
- remainder of a list of numbers
- expr - the numbers
returns - the result of the remainder operation
- (min expr...)
- the smallest of a list of numbers
- expr - the expressions to be checked
returns - the smallest number in the list
- (max expr...)
- the largest of a list of numbers
- expr - the expressions to be checked
returns - the largest number in the list
- (abs expr)
- the absolute value of a number
- expr - the number
returns - the absolute value of the number
- (gcd n1 n2...)
- compute the greatest common divisor
- n1 - the first number [integer]
n2 - the second number[s] [integer]
returns - the greatest common divisor
- (random n)
- compute a random number between 0 and n-1 inclusive
- n - the upper bound [integer]
returns - a random number
- (sin expr)
- compute the sine of a number
- expr - the floating point number
returns - the sine of the number
- (cos expr)
- compute the cosine of a number
- expr - the floating point number
returns - the cosine of the number
- (tan expr)
- compute the tangent of a number
- expr - the floating point number
returns - the tangent of the number
- (asin expr)
- compute the arcsine
- expr - the floating point number
returns - the arcsine of the number
Note: not implemented in Nyquist.
- (acos expr)
- compute the arccosine
- expr - the floating point number
returns - the arccosine of the number
Note: not implemented in Nyquist.
- (atan expr
[expr2]) - compute the arctangent
- expr - the value of x
expr2 - the value of y [default value is 1.0]
returns - the arctangent of x/y
- (expt x-expr
y-expr) - compute x to the y power
- x-expr - the floating point number
y-expr - the floating point exponent
returns - x to the y power
- (exp x-expr)
- compute e to the x power
- x-expr - the floating point number
returns - e to the x power
- (sqrt expr)
- compute the square root of a number
- expr - the floating point number
returns - the square root of the number
- ( <
n1 n2...) - test for less than
( <=
n1 n2...) - test for less than or equal to
( =
n1 n2...) - test for equal to
( /=
n1 n2...) - test for not equal to
( >=
n1 n2...) - test for greater than or equal to
( >
n1 n2...) - test for greater than
- n1 - the first number to compare
n2 - the second number to compare
returns - T if the results of comparing n1 with n2, n2
with n3, etc., are all true.
XLISP >
XLISP 2.0 -
Contents -
Reference -
Previous |
Next