Skip To Content

Mod function

Available with Image Analyst license.

Available with Spatial Analyst license.

Overview

Finds the remainder (modulo) of the first raster when divided by the second raster on a pixel-by-pixel basis.

Mod illustration

Notes

The order of the inputs is important and affect the output result.

Mod assumes both its inputs are integers. If any inputs are not integer, those inputs will be converted to integers through truncation. Output values are always integers.

Any value modulated (divided) by 0 is assigned NoData in the output. Therefore, any location on the second input that is either 0 or NoData will return NoData for that location on the output.

If the second input value (the divisor) is larger than the first input value (the dividend), the output will be the same value as the first input. For example, if you were to divide a value of 8 by the value 10, the integer division calculation will return the input value 8 for the remainder.

Parameters

Parameter nameDescription

Raster

The numerator input.

A constant value can be used as an input for this parameter, provided a raster is specified for the other parameter.

Raster2

The denominator input.

A constant value can be used as an input for this parameter, provided a raster is specified for the other parameter.

Extent Type

Choose which extent should be used in the output raster:

  • First Of—Use the extent of the first input raster to determine the processing extent.

  • Intersection Of—Use the extent of the overlapping pixels to determine the processing extent. This is the default.
  • Union Of—Use the extent of all the rasters to determine the processing extent.
  • Last Of—Use the extent of the last input raster to determine the processing extent.

Cellsize Type

Choose which cell size to use in the output raster. If all the input cell sizes are the same, all the options will yield the same results.

  • First Of—Use the first cell size of the input rasters.
  • Min Of—Use the smallest cell size of all the input rasters.
  • Max Of—Use the largest cell size of all the input rasters. This is the default.
  • Mean Of—Use the mean cell size of all the input rasters.
  • Last Of—Use the last cell size of the input rasters.