Skip to main content

Divide

Module Info:

moduleType: "internal",
moduleName: "divide"

Description

The divide function divides A by B.

Inputs

NameTypeRequired
Anumber
Bnumber

Outputs

NameType
resultnumber
errorDivideByZerostring
errorNaNstring

The errorNaN property will only be defined if any of B or A are not numbers. The errorDivideByZero will only be defined if B is equal to zero.

Examples

Inputs Outputs
A B result errorDivideByZero errorNaN
10 2 5 undefined undefined
5 -2 -2.5 undefined undefined
2 "foo" undefined undefined "One of the arguments provided was not a number"
2 0 undefined "Cannot divide by zero" undefined