From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
The / character is used to perform floating-point division between two numbers.
result=expression1 / expression2
|result||Double||The division of expression1 and expression2.|
|expression1||Number||Any numeric expression.|
|expression2||Number||Any numeric expression.|
Use this operator when you require division that considers the decimal portion of the expressions. You can use Operator_Divide to define the / operator for classes.
Regardless of the datatypes of expression1 and expression2, both operands are coerced to Doubles and the result is a Double. If you divide by zero, the result is positive or negative infinity, except if the numerator is also zero. In that case, the result is NaN. For that reason, you should always check to see whether the denominator is zero before using /.
This example stores the quotient of two numbers in a variable: