# CL170 Math (Decimal)

Instructions · `Math (Decimal)` · verification: source checked

Math (Decimal) is a ladder-program instruction that evaluates a user-defined formula using decimal values and stores the result in a memory address. The formula is built on a Math dialog using a keypad and address picker, and parenthetical expressions can be nested up to eight levels. If floating point is used in any operation, all operations use floating-point math, and the result is converted to the data type of the assigned memory address.

## Specification

| Property | Value |
|---|---|
| Language | ladder |
| Code | Math (Decimal) |
| Group | Math |

### Parameters

| Name | Data type | Description |
|---|---|---|
| Result | Memory Address | Memory address where the Result is stored; the Result value is adjusted to the data type of the Memory Address. |
| Type |  | Selecting Decimal or Hex determines the mathematical operations available on the Math instruction dialog; changing this selection after beginning the formula erases the formula. |
| One Shot |  | Solves the formula only once after each OFF-to-ON transition of the enabling rung. |
| Error Flags | System Bits | System Bits that turn ON when the specified condition has occurred. |
| Address or Nickname |  | Data Registers can be identified in the formula by Memory Address or Nickname. |
| Formula Pad |  | Create the mathematical expression using the onscreen keypad, the keyboard, and Address Picker. |

## Safety

- MAX, MIN, MDN, AVG, RAND, and ABS are not supported on C0-0x Series CPUs.

## Study notes

- Parenthetical expressions can be nested up to eight levels deep.
- If the Floating Point Data Type is used in any operation, all operations are based on Floating Point math.
- The result value is adjusted to the data type of the assigned Memory Address.
- Changing the Type selection after beginning to develop the formula erases the formula.
- One Shot solves the formula only once after each OFF-to-ON transition of the enabling rung.
- Error Flags are System Bits that turn ON when the specified condition has occurred.
- Data Registers can be identified in the formula by Memory Address or Nickname.
- Trig functions can be solved in Radians, and RAD and DEG convert between degrees and radians.
- The document references a separate Math (Hex) instruction for hexadecimal values.

## Sources

1. [Related Topics:](https://cdn.automationdirect.com/static/helpfiles/click/Content/170.htm) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/click-math-decimal  
JSON: https://machineschema.com/instruction/click-math-decimal.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
