Operator

# / (Division)

<div class="rst-class">

forsearch

</div>

/

<div class="rst-class">

forsearch

</div>

Operator

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

The / character is used to perform floating-point <span class="title-ref">Division</span> between two numbers.

## Usage

``` xojo
result = expression1 / expression2
```

| Part        | Type                             | Description                                      |
|-------------|----------------------------------|--------------------------------------------------|
| result      | `Double</api/data_types/double>` | The division of *expression1* and *expression2*. |
| expression1 | Number                           | Any numeric expression.                          |
| expression2 | Number                           | Any numeric expression.                          |

## Notes

Use this operator when you require <span class="title-ref">Division</span> that considers the decimal portion of the expressions. You can use `Operator Divide</api/language/operators/operator_overloads/operator_divide>` to define the / operator for classes.

Regardless of the datatypes of *expression1* and *expression2*, both operands are coerced to `Doubles</api/data_types/double>` and the result is a `Double</api/data_types/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 /.

Note that if the result is assigned to an integer type, the behavior is undefined because integers cannot represent NaN or infinity. The actual value stored will vary by platform and should not be relied upon.

Use the `\` operator for `Integer Division</api/language/operators/mathematical/integer_division>` or the `Mod</api/language/operators/mathematical/mod>` operator to get the remainder of the <span class="title-ref">Division</span>.

## Sample code

This example stores the quotient of two numbers in a variable:

``` xojo
Var x As Double
x = 50.56 / 30.34 ' x is 1.6664469
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`Integer Division</api/language/operators/mathematical/integer_division>` , `Mod</api/language/operators/mathematical/mod>` operators; `Operator Divide</api/language/operators/operator_overloads/operator_divide>` function; `Operator Precedence</api/language/operators/operator_precedence>`

</div>
