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

Divide$

The Divide$ function divides two floating point numbers represented as strings.

Usage

Used to divide 2 reals.

Syntax

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

Parameters

<real1>, string, first real, dividend.

<real2>, string, second real,divisor.

<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.
    3 if division by zero

Return value

result$, string containing the division result.

See also

DecimalSeparator$
Precision
Add$
Multiply$
Subtract$

Examples

a$=Divide$("13.56","145.789")     'a$ contains "0.09"

a$=Divide$("-45.678","34.8976")  'a$ contains "-1.31"

#Precision=3
a$=Divide$("567.34257","45.343")     'a$ contains "12.512"