/ or ÷ (Divide)
VALUE1
/
VALUE2

The / operator divides one numeric value by another.

Parameters

This operator has two parameters:

value1 – The first numeric value.

value2 – The second numeric value.

Description

This operator performs division just like you learned in grade school. The result is always a floating point number, even if the answer could be expressed as an integer.

    20/5 ☞ 4.0000
    21/5 ☞ 4.20000
    21.6/6.25 ☞ 3.4560

You can use the ÷ symbol for division instead of the / symbol.

    20 ÷ 5 ☞ 4.0000
    21 ÷ 5 ☞ 4.20000
    21.6 ÷ 6.25 ☞ 3.4560

Dividing by Zero

If you divide any number by 0, the result is infinity:

    3/0 ☞ inf

It’s numerically incorrect, but if you would prefer that the result of dividing by zero be zero then use the divzero( function:

    divzero(3/0) ☞ 0.0000

You can also use the divzeroerror( function if you would prefer that an error be generated.

See Also

- - -- subtracts the numeric value on the right from the numeric value on the left.
- * -- multiplies the numeric value on the left by the numeric value on the right.
- \ -- performs integer division.
- ^ -- raises a number to a power.
- + -- works differently depending on the type of operands used with it. If both operands are numeric, it does numerical addition. If either operand is text the + operator concatenates (joins together) the two operands.
- abs( -- calculates the absolute value of a number.
- ceil( -- converts a number to an integer, truncating toward positive infinity.
- divzero( -- divides two numbers, returns zero if denominator is zero.
- divzeroerror( -- divides two numbers, returns an error if the denominator is zero.
- fix( -- converts a number to an integer, truncating toward zero.
- fixed -- converts a floating point number to fixed point.
- float( -- converts a fixed point number to a floating point number.
- infinity( -- returns infinity.
- int( -- converts a number to an integer, truncating toward negative infinity.
- mod -- computes the remainder (modulo) after integer division.
- nan( -- checks to see if a numeric value is invalid.
- randominteger( -- generates a random integer between the starting and ending values.
- rnd( -- generates a random number between 0 and 1.
- round( -- rounds a number to a specified increment.
- validnumber( -- checks to see if a numeric value is valid.

History

Version | Status | Notes
10.0 | Updated | The / operator has two major changes from earlier versions of Panorama: 1) Division is always performed in floating point even if all operands are integers, and 2) The result of dividing by zero is infinity instead of an error message.