help mata add()help mata subtract()help mata product()help mata divide()-------------------------------------------------------------------------------

Title

Fundamental arithmetic operations for use with rpnfcn()

Syntax

Command nameArgument

&add()NULL

&subtract()NULL

&product()NULL

÷()NULL

DescriptionThese functions perform the four fundamental arithmetic operations on the two top elements of the stack. They remove the top element and replaces the upper but one element with the result of the operation, i.e. the number of elements in the stack are reduced by one and the result is the new top element. All four perform their operations element-wise without checking for conformability as they rely on the Mata colon operators

:+,:-+,:*, and:/, see Mata colon operators.&subtract()subtracts the current top element of the stack element from the element just below,÷()divides the upper but one element of the stack with the top element.

Source coderpnbinop.mata

AuthorHenrik Støvring, Research Unit of General Practice, University of Southern Denmark. Please email hstovring@health.sdu.dk if you have comments, questions or observe any problems.

Also seeManual:

[M] Mata Reference ManualOnline: help for

[M-0] mata,Evaluation of algorithm matrix using RPN,RPN stack manipulation functions,RPN distribution functions,RPN functions for integration