Skip to content

Divide

Divide computes input 0 divided by input 1.

y = a / b

Port Direction Type
0, 1 Input Same numeric scalar type; input 0 may be a numeric array when input 1 is its scalar element type
0 Output Same type as input 0

Array-by-array division is not supported by this block; use an element-wise expression where needed.

Integer division truncates toward zero. An integer divisor of zero has no result. When both inputs are constants, such as a 1 / 0 built from two i32 Constant blocks, the simulation build fails with attempt to divide by zero; otherwise the run stops with that error when the zero arrives.

Floating-point division by zero follows IEEE-754 behavior: 1.0 / 0.0 is inf, and 0.0 / 0.0 is NaN. A plot draws neither as a point; it leaves a gap and shows the value above the plot.

None.

For inputs a = 12.0 and b = 3.0, the output is y = 4.0.