Numeric operators

XBUILD accepts the following numeric operators:

Operator

Description

+

  • addition, adds two numbers.
  • string concatenation, joins two strings.
  • if given a string and a number, the string is converted into a number and then the two numbers are added.

-

subtraction, subtracts two numbers

*

multiplication, multiplies two numbers

/

division, divides two numbers

%

Modulo operation. Performs an integer division and returns the remainder. For example if <ROT1-WIND> returned a value of 380, then [<ROT1-WIND>%360] will return 20.

tan(num)

Computes the tangent of an angle (given in radians).

sind(num)

Computes the sine of an angle (given in degrees).

cosd(num)

Computes the cosine of an angle (given in degrees).

tand(num)

Computes the tangent of an angle (given in degrees).

asin(num)

Computes the arcsine (in radians) of a number.

acos(num)

Computes the arccosine (in radians) of a number.

atan(num)

Computes the arctangent (in radians) of a number.

atan2(y,x)

Computes the arctangent (in radians) of y/x.

asind(num)

Computes the arcsine (in degrees) of a number.

fabs(num)

Computes the absolute value of the number.

in2mm(num)

Converts inches to millimeters.

anglexy(x,y)

Computes the angle between the X-axis to the line between (0,0) and (x,y).

acosd(num)

Computes the arccosine (in degrees) of a number.

atand(num)

Computes the arctangent (in degrees) of a number.

atan2d(y,x)

Computes the arctangent (in degrees) of y/x.

ceil(num)

returns the nearest integer greater than or equal to a number.

sqrt(num)

Returns the square root of a number.

mm2in(millimeters)

Converts from millimeters to inches.

exp(num)

Returns e^x where e = 2.71828.

log(num)

Returns ln(x) where ln is the natural logarithm.

log10(num)

Returns the base-10 logarithm of a number.

pow(base,power)

Returns a base number raised to a power.

degtorad(num)

Returns an angle in radians as converted from degrees.

radtodeg(num)

Returns an angle in degrees as converted from radians.

pi

The mathematical value of pi to ten decimal places.

radiusxy(x,y)

Computes the distance from the origin to XY.

Example

If b = 12

The following line

[:a=b%10]

results in a = 2

The operation performed by the modulo operator is to return the remainder of a division. So a 12 divided by 10 will result in a remainder of 2. This can be used to restrict the angles between 0 and 360 on machines that require this limitation.