Home > Language Reference > Floating Point Calculation Functions > Add$

Add$

The Add$ function adds two strings representing floating point numbers.

Usage

Used to add 2 reals.

Syntax

result$=Add$(<real1>, <real2> [, <ret>])

Parameters

<real1>, string, first real to add.

<real2>, string, second real to add

<ret>, integer, optional return code. Values are :
    0 if successfull operation.
    1 if parameters are not valid (for instance, the string does not contain a valid number).
    2 if operation causes an overflow.

Return value

result$, string containing the addition result.


See also

DecimalSeparator$
Precision
Divide$
Multiply$
Subtract$

Examples

a$=Add$("13.56","145.789")     'a$ contains "159.35"

a$=Add$("-45.678","34.8976")     'a$ contains "-10.78"

#Precision=3
    a$=Add$("567.34257","45.343")     'a$ contains "612.686"