---
title: Supported operations on expressions
slug: supported-operations-on-expressions
docTags: 
createdAt: 2023-12-17T23:03:44.858Z
---

# Unary operations

| **Operation** | **Description**                                           |
| ------------- | --------------------------------------------------------- |
| abs           | Absolute Value                                            |
| acos          | Arc cosine                                                |
| asin          | Arc sine                                                  |
| atan\[y]\[x]  | Arc tangent                                               |
| cos           | Cosine                                                    |
| exp           | e raised to                                               |
| fix           | Round down                                                |
| fup           | Round up                                                  |
| int           | Integer part                                              |
| ln            | Natural log of                                            |
| round         | Round                                                     |
| sin           | Sine                                                      |
| sqrt          | Square root                                               |
| tan           | tangent                                                   |
| not           | Logical not                                               |
| ResetModulo   |  \[A\|B\|C]  reset a rotation axis to its modulo position |

# Binary Operations

| **Operation** | **Description**          |
| ------------- | ------------------------ |
| /             | Divided by               |
| mod           | Modulo                   |
| \*\*          | Power                    |
| \*            | Times                    |
| and           | Logic AND                |
| xor           | Logic exclusive OR       |
| -             | Minus                    |
| or            | logic nonexclusive OR    |
| +             | Plus                     |
| >             | Greater then             |
| >=            | Greater than or equeal   |
| \<            | Less then                |
| \<=           | Less than or equal       |
| ==            | Is equel                 |
| \<>           | Not equeal               |
| band          | Bitwise AND              |
| bxor          | Bitwise exclusive OR     |
| bor           | Bitwise nonexeclusive OR |
| \<\<          | Shift left               |
| >>            | Shift right              |

# Example

This example drills holes at a circle with a radius of 10, each 30 degrees. The code that performs this is put in a subroutine, which can be called as many times as needed in the main program.&#x20;

:::BlockQuote
sub do\_circle\_holes &#x20;
\#100=0
g0 z1 x0 y0&#x20;
while \[#100 \<> 360]   &#x20;
&#x20;  \#102 = \[10 \* sin\[#100]]   &#x20;
&#x20;  \#103 = \[10 \* cos\[#100]]   &#x20;
&#x20;  g0 x\[#103] y\[#102]     &#x20;
&#x20;  g1 z-1   &#x20;
&#x20;  g1 z1  &#x20;
&#x20;  \#100 = \[#100 + 30]   &#x20;
&#x20;  if \[#100 == 360]     &#x20;
&#x20;     msg "Done"  &#x20;
&#x20;  else     &#x20;
&#x20;     msg "processing at angle "#100  &#x20;
&#x20;  endif &#x20;
endwhile  &#x20;

endsub &#x20;

gosub do\_circle\_holes&#x20;

M30
:::

