/ Operator

Language Items List

Definition:

An arithmetic operator used to divide two numbers and return a floating-point result.

Syntax:

result = expr1 / expr2


Syntax Description


expr1 Any numeric expression

expr2 Any numeric expression

Details:

The result data type is usually Double, however, the following exceptions exist:

images/Phx90000.gif When both expressions are Integer or Single, result is Single unless it goes beyond its valid range. If it goes beyond the range, result is Double.

images/Phx90000.gif When both expressions are an Integer, or a Single, result is Single unless it goes beyond its valid range. If it overflows, result is a Double.

See Also:

Arithmetic Operators
Comparison Operators
Operator Precedence

Example:

Print 4/5 => 0 because two integers divided produces another integer, while

4.0/5 => 0.8 because there is a higher type involved the precision is maintained.