Skip to main content

Difference

Returns the difference of two inputs.

Difference block

Description​

The Difference block returns the difference of two inputs. This is a code block from the Math drawer.

Usage​

Returns the difference of two inputs.

Syntax​

Inputs in this block:

  • A number
  • A number

The latter of which will be subtracted from the former.

Example​

This is a model of elephant health given factors that nourish the elephant (grass) and factors that harm the elephant (poachers). When an elephant's health falls to zero, it is no longer visible. This demonstrates the negative impact of poachers on elephant populations.

Difference example code