This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

## Synopsis

### Arguments

 num An expression that resolves to a numeric value.

## Description

The FADD function adds two numbers and returns the result. If a num value is a null string or a non-numeric value, FADD parses its value as 0 (zero).

You can perform the same operation using the addition operator (+). Refer to the Operators page of this manual.

### Arithmetic Operations

• To perform arithmetic operations on floating point numbers, use the FADD, FSUB, FMUL, and FDIV functions, or use the standard arithmetic operators.

• To perform arithmetic operations on numeric strings, use the SADD, SSUB, SMUL, and SDIV functions.

• To perform integer division, use the DIV function. To perform modulo division, use the MOD function.

• To perform arithmetic operations on corresponding elements of dynamic arrays, use the ADDS, SUBS, MULS, DIVS, and MODS functions.

• To add together the element values within a single dynamic array, use either the SUM function (for single-level dynamic arrays) or the SUMMATION function (for multi-level dynamic arrays).

• To perform numeric comparison operations, use the SCMP function, or use the standard comparison operators.

## Examples

The following example uses the FADD function to add two floating point numbers:

a=11.95
b=10.25