{"id":"click-math-decimal","model_id":"Math (Decimal)","name":"CL170 Math (Decimal)","summary":"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.","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."],"safety_notes":["MAX, MIN, MDN, AVG, RAND, and ABS are not supported on C0-0x Series CPUs."],"sources":[{"url":"https://cdn.automationdirect.com/static/helpfiles/click/Content/170.htm","title":"Related Topics:","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":16,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"ladder","code":"Math (Decimal)","group":"Math","parameters":[{"name":"Result","data_type":"Memory Address","description":"Memory address where the Result is stored; the Result value is adjusted to the data type of the Memory Address."},{"name":"Type","description":"Selecting Decimal or Hex determines the mathematical operations available on the Math instruction dialog; changing this selection after beginning the formula erases the formula."},{"name":"One Shot","description":"Solves the formula only once after each OFF-to-ON transition of the enabling rung."},{"name":"Error Flags","data_type":"System Bits","description":"System Bits that turn ON when the specified condition has occurred."},{"name":"Address or Nickname","description":"Data Registers can be identified in the formula by Memory Address or Nickname."},{"name":"Formula Pad","description":"Create the mathematical expression using the onscreen keypad, the keyboard, and Address Picker."}],"related":[],"standards":[]},"url":"https://machineschema.com/instruction/click-math-decimal","license":"https://creativecommons.org/licenses/by/4.0/"}