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

Subtract$

The Subtract$ function subtracts two strings representing floating point numbers.

Usage

Used to adding 2 reals.

Syntax

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

Parameters

<real1>, string, first real.

<real2>, string, second real to subtract from the first real.

<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 subtraction result.

See also

DecimalSeparator$
Precision
Add$
Divide$
Multiply$

Examples

a$=Subtract$("13.56","145.789")     'a$ contains "-132.23"

a$=Subtract$("-45.678","34.8976")  'a$ contains "-80.58"

#Precision=3
a$=Subtract$("567.34257","45.343")     'a$ contains "522.000"